Raiana API Reference

OpenAI-compatible API for medical device regulatory augmented intelligence — MDR, IVDR, FDA, and EU AI Act

The Raiana API provides programmatic access to our regulatory AI assistants: ChatMDR, ChatIVDR, ChatFDA, and ChatAIAct. Each assistant is augmented with up-to-date regulatory texts, MDCG guidance documents, FDA guidances and related acts and regulations.

The API follows the OpenAI Chat Completions and Responses formats, making it easy to integrate using the OpenAI Python library, any OpenAI-compatible client, or plain HTTP requests.

Please note: the Responses API is currently in beta!

Raiana Models API

Authentication

These endpoints do not currently enforce an Authorization header, unlike /v1/chat/completions and /v1/responses. We recommend always sending your API key anyway, since this may become required in the future:

Authorization: Bearer raikey_YOUR_API_KEY_HERE

List Models

GET /v1/models

Returns a list of all available models.

Example Request

curl https://api.chatmdr.eu/v1/models \
  -H "Authorization: Bearer raikey_YOUR_API_KEY_HERE"

Response Format

{
  "object": "list",
  "data": [
    {
      "id": "chatmdr-fast-openai",
      "object": "model",
      "owned_by": "ChatMDR",
      "created": 1751373000
    },
    {
      "id": "chatmdr-smart-openai",
      "object": "model",
      "owned_by": "ChatMDR",
      "created": 1751373000
    }
  ]
}

Response Fields

FieldTypeDescription
objectstringAlways "list".
dataarrayThe list of available models.
data[].idstringThe model identifier — pass this as model in /chat/completions and /responses requests.
data[].objectstringAlways "model".
data[].owned_bystringThe product that owns the model.
data[].creatednumberUnix timestamp. This is currently a fixed value shared by every model, not a real per-model creation date.

Error Handling

Status CodeMeaning
500Internal error loading the model catalog.

Retrieve Model

GET /v1/models/{model_id}

Returns details about a specific model.

Path Parameters

ParameterTypeDescription
model_id requiredstringThe ID of the model to retrieve, e.g. chatmdr-fast-openai.

Example Request

curl https://api.chatmdr.eu/v1/models/chatmdr-fast-openai \
  -H "Authorization: Bearer raikey_YOUR_API_KEY_HERE"

Response Format

{
  "id": "chatmdr-fast-openai",
  "object": "model",
  "owned_by": "ChatMDR",
  "created": 1751373000
}

Response Fields

Same shape as one entry of data[] in List Models above: id, object, owned_by, created.

Error Handling

Status CodeMeaning
404No model exists with the given model_id. Response body is empty.
500Internal error loading the model catalog.

Available Models

Each model ID identifies both a product (which regulatory domain it answers questions about) and a tier (response speed/depth trade-off). Fast models optimize for low latency and shorter answers; Smart models allow longer, more thorough answers with deeper reasoning. All models support web search and file/document grounding when building an answer.

ChatMDR — EU Medical Device Regulation

Model IDTierMax output tokens*
chatmdr-fast-openaiFast256
chatmdr-smart-openaiSmart2048

ChatIVDR — EU In Vitro Diagnostic Regulation

Model IDTierMax output tokens*
chativdr-fast-openaiFast256
chativdr-smart-openaiSmart2048

ChatFDA — US FDA Medical Device Regulation

Model IDTierMax output tokens*
chatfda-fast-openaiFast256
chatfda-smart-openaiSmart2048

ChatAIAct — EU AI Act

Model IDTierMax output tokens*
chataiact-fast-openaiFast256
chataiact-smart-openaiSmart2048

* Default output cap. Callers can override it per request (max_tokens on /chat/completions, max_output_tokens on /responses), clamped to the range 100..4096.

Raiana Chat Completions API

Authentication

All requests must include an API key in the Authorization header using the Bearer token scheme:

Authorization: Bearer raikey_YOUR_API_KEY_HERE

Raiana API keys use the raikey_ prefix.


Create Chat Completion

POST /v1/chat/completions

Given a list of messages, returns a single model-generated reply. This endpoint is not streamed — for a streamed alternative, see the Responses API.

Request Body Parameters

ParameterTypeDescription
model requiredstringThe ID of the model to use. See the Models API for the full list.
messages requiredarrayA list of messages comprising the conversation so far. Each message is an object with a role and content. At least one message is required, and the last message must have role user.
max_tokens optionalintegerMaximum number of tokens to generate in the response. Must be between 100 and 4096. Defaults to the selected model’s configured output limit.

Not supported on this endpoint: stream, tools / tool_choice / functions / function_call, multiple choices (n), and multimodal message content — content must be a plain string.

Message Roles

RoleBehavior
system / developerSets additional instructions on top of the built-in regulatory system prompt. The built-in prompt always takes precedence — your instructions supplement it rather than replace it.
userA message from the user (the question or input).
assistantA previous response from the assistant. Use alternating user and assistant messages to provide conversation history.

Example Request

curl -X POST https://api.chatmdr.eu/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer raikey_YOUR_API_KEY_HERE" \
  -d '{
    "model": "chatmdr-fast-openai",
    "messages": [
      {
        "role": "user",
        "content": "What is a Class III medical device under MDR?"
      }
    ],
    "max_tokens": 1024
  }'

Response Format

{
  "object": "chat.completion",
  "id": "825c3790-ec66-4008-8b30-99efd968707c",
  "model": "chatmdr-fast-openai",
  "created": 1751373000,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Under MDR, Class III devices are the highest risk class..."
      }
    }
  ],
  "usage": {
    "input_tokens": 5820,
    "output_tokens": 387,
    "total_tokens": 6207,
    "input_tokens_details": { "cached_tokens": 0 },
    "output_tokens_details": { "reasoning_tokens": 0 }
  }
}

Response Fields

FieldTypeDescription
objectstringAlways "chat.completion".
idstringA unique identifier for this completion request.
modelstringThe model used to generate the response.
creatednumberUnix timestamp of when the response was generated.
choicesarrayAn array containing the generated response. Always contains exactly one choice.
choices[0].indexintegerAlways 0.
choices[0].message.rolestringAlways "assistant".
choices[0].message.contentstringThe generated regulatory answer.
usageobjectToken usage statistics for the request.
usage.input_tokensintegerNumber of tokens in the prompt (including regulatory context added by Raiana).
usage.output_tokensintegerNumber of tokens in the generated response.
usage.total_tokensintegerTotal tokens consumed (input + output).
usage.input_tokens_details.cached_tokensintegerPortion of input_tokens served from cache.
usage.output_tokens_details.reasoning_tokensintegerPortion of output_tokens used for internal reasoning.

Error Handling

Status CodeMeaning
400Bad request — missing or invalid parameters (e.g., unknown model, empty messages, max_tokens out of range).
401Unauthorized — missing, invalid, or malformed API key.
402Payment required — insufficient token balance or no remaining questions on subscription.
403Forbidden — no active subscription found for an app-scoped key.
412Precondition failed — app-scoped key used without the required X-Raiana- prefix on user.
500Internal server error. Contact support if this persists.
502Upstream error — the Raiana backend encountered an error processing your request.

Raiana Responses API (beta)

Do not use this API for production use yet. You can report bugs to info@raiana.ai.

Authentication

All requests must include an API key in the Authorization header using the Bearer token scheme:

Authorization: Bearer raikey_YOUR_API_KEY_HERE

Create Response

POST /v1/responses

Given text input, returns a single model-generated reply — either as a complete JSON object, or streamed as Server-Sent Events. This is a text-only, OpenAI Responses-compatible endpoint.

Request Body Parameters

ParameterTypeDescription
model requiredstringThe ID of the model to use. See the Models API for the full list.
input requiredstring or arrayThe input to the model. Either a plain string, or an array of strings and/or message objects — see Input Items below. Must resolve to at least one user message.
instructions optionalstringAdditional instructions layered on top of the model’s built-in regulatory system prompt. Equivalent to sending a system/developer message on the Chat Completions endpoint — supplements the built-in prompt rather than replacing it.
stream optionalbooleanIf true, the response is streamed as Server-Sent Events. Defaults to false.
conversationId optionalstringRaiana conversation identifier used to continue a previous conversation.
previous_response_id optionalstringAlias of conversationId. If both are provided, they must match.
max_output_tokens optionalintegerMaximum number of tokens to generate in the response. Must be between 100 and 4096. Defaults to the selected model’s configured output limit.

Not supported on this endpoint: tools, tool_choice, functions, function_call, and parallel_tool_calls (all rejected with 400), non-text modalities, and non-text content parts inside input (images/audio/video).

Input Items

When input is an array, each item is either a plain string (treated as a user message) or a message object:

FieldTypeDescription
typestringIf present, must be "message".
rolestringOne of system, developer, user, assistant. Defaults to user.
contentstring or arrayA plain string, or an array of content part objects.

Each content part object has a type of input_text, text, or output_text, and a text string field.

Example Request

curl -X POST https://api.chatmdr.eu/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer raikey_YOUR_API_KEY_HERE" \
  -d '{
    "model": "chatmdr-smart-openai",
    "input": "What are the MDR classification rules for active implantable devices?",
    "max_output_tokens": 1024
  }'

Response Format

{
  "id": "resp_825c3790",
  "object": "response",
  "created_at": 1751373000,
  "status": "completed",
  "model": "chatmdr-smart-openai",
  "output": [
    {
      "id": "msg_resp_825c3790",
      "type": "message",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Active implantable devices are classified as Class III...",
          "annotations": []
        }
      ]
    }
  ],
  "output_text": "Active implantable devices are classified as Class III...",
  "usage": {
    "input_tokens": 5820,
    "output_tokens": 387,
    "total_tokens": 6207,
    "input_tokens_details": { "cached_tokens": 0 },
    "output_tokens_details": { "reasoning_tokens": 0 }
  },
  "conversationId": "resp_825c3790"
}

Response Fields

FieldTypeDescription
idstringA unique identifier for this response. Pass it as conversationId on a later request to continue the conversation.
objectstringAlways "response".
created_atnumberUnix timestamp of when the response was generated.
statusstringAlways "completed" for a successful non-streaming response.
modelstringThe model used to generate the response.
outputarrayArray containing the generated message. Always contains exactly one item.
output[0].rolestringAlways "assistant".
output[0].content[0].textstringThe generated regulatory answer.
output_textstringConvenience field with the same text as output[0].content[0].text.
usageobjectToken usage statistics, same shape as on Chat Completions.
conversationIdstringIdentifier to pass back as conversationId (or previous_response_id) to continue this conversation.

Streaming

Pass "stream": true to receive the response as Server-Sent Events instead of a single JSON object.

curl -X POST https://api.chatmdr.eu/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer raikey_YOUR_API_KEY_HERE" \
  -d '{
    "model": "chatmdr-smart-openai",
    "input": "Summarize Article 10 obligations for manufacturers.",
    "stream": true
  }'

The response has Content-Type: text/event-stream and emits a sequence of named events, each with a data: payload, ending in a final data: [DONE] line:

EventDescription
response.createdEmitted once, immediately, with status: "in_progress".
response.in_progressEmitted once, immediately after response.created.
response.output_text.deltaEmitted for each generated text chunk. delta contains the incremental text.
response.output_text.doneEmitted once, with the full generated text.
response.completedEmitted once, with the same full response object described in Response Fields above, under response.
response.errorEmitted instead of response.completed if an error occurs mid-stream. error.message and error.code describe the failure.

Example Event

event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"Active ","output_index":0,"content_index":0}

Error Handling

Status CodeMeaning
400Bad request — missing or invalid parameters, unsupported tools/modalities, or non-text input.
401Unauthorized — missing, invalid, or malformed API key.
402Payment required — insufficient token balance or no remaining questions on subscription.
403Forbidden — no active subscription found for an app-scoped key.
412Precondition failed — app-scoped key used without the required X-Raiana- prefix on user.
500Internal server error. Contact support if this persists.
502Upstream error — the Raiana backend encountered an error processing your request.
504Timeout waiting for a streamed response to complete.