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
| Field | Type | Description |
|---|---|---|
object | string | Always "list". |
data | array | The list of available models. |
data[].id | string | The model identifier — pass this as model in /chat/completions and /responses requests. |
data[].object | string | Always "model". |
data[].owned_by | string | The product that owns the model. |
data[].created | number | Unix timestamp. This is currently a fixed value shared by every model, not a real per-model creation date. |
Error Handling
| Status Code | Meaning |
|---|---|
500 | Internal error loading the model catalog. |
Retrieve Model
GET /v1/models/{model_id}
Returns details about a specific model.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
model_id required | string | The 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 Code | Meaning |
|---|---|
404 | No model exists with the given model_id. Response body is empty. |
500 | Internal 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 ID | Tier | Max output tokens* |
|---|---|---|
chatmdr-fast-openai | Fast | 256 |
chatmdr-smart-openai | Smart | 2048 |
ChatIVDR — EU In Vitro Diagnostic Regulation
| Model ID | Tier | Max output tokens* |
|---|---|---|
chativdr-fast-openai | Fast | 256 |
chativdr-smart-openai | Smart | 2048 |
ChatFDA — US FDA Medical Device Regulation
| Model ID | Tier | Max output tokens* |
|---|---|---|
chatfda-fast-openai | Fast | 256 |
chatfda-smart-openai | Smart | 2048 |
ChatAIAct — EU AI Act
| Model ID | Tier | Max output tokens* |
|---|---|---|
chataiact-fast-openai | Fast | 256 |
chataiact-smart-openai | Smart | 2048 |
* 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
| Parameter | Type | Description |
|---|---|---|
model required | string | The ID of the model to use. See the Models API for the full list. |
messages required | array | A 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 optional | integer | Maximum 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
| Role | Behavior |
|---|---|
system / developer | Sets 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. |
user | A message from the user (the question or input). |
assistant | A 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
| Field | Type | Description |
|---|---|---|
object | string | Always "chat.completion". |
id | string | A unique identifier for this completion request. |
model | string | The model used to generate the response. |
created | number | Unix timestamp of when the response was generated. |
choices | array | An array containing the generated response. Always contains exactly one choice. |
choices[0].index | integer | Always 0. |
choices[0].message.role | string | Always "assistant". |
choices[0].message.content | string | The generated regulatory answer. |
usage | object | Token usage statistics for the request. |
usage.input_tokens | integer | Number of tokens in the prompt (including regulatory context added by Raiana). |
usage.output_tokens | integer | Number of tokens in the generated response. |
usage.total_tokens | integer | Total tokens consumed (input + output). |
usage.input_tokens_details.cached_tokens | integer | Portion of input_tokens served from cache. |
usage.output_tokens_details.reasoning_tokens | integer | Portion of output_tokens used for internal reasoning. |
Error Handling
| Status Code | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters (e.g., unknown model, empty messages, max_tokens out of range). |
401 | Unauthorized — missing, invalid, or malformed API key. |
402 | Payment required — insufficient token balance or no remaining questions on subscription. |
403 | Forbidden — no active subscription found for an app-scoped key. |
412 | Precondition failed — app-scoped key used without the required X-Raiana- prefix on user. |
500 | Internal server error. Contact support if this persists. |
502 | Upstream 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
| Parameter | Type | Description |
|---|---|---|
model required | string | The ID of the model to use. See the Models API for the full list. |
input required | string or array | The 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 optional | string | Additional 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 optional | boolean | If true, the response is streamed as Server-Sent Events. Defaults to false. |
conversationId optional | string | Raiana conversation identifier used to continue a previous conversation. |
previous_response_id optional | string | Alias of conversationId. If both are provided, they must match. |
max_output_tokens optional | integer | Maximum 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:
| Field | Type | Description |
|---|---|---|
type | string | If present, must be "message". |
role | string | One of system, developer, user, assistant. Defaults to user. |
content | string or array | A 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
| Field | Type | Description |
|---|---|---|
id | string | A unique identifier for this response. Pass it as conversationId on a later request to continue the conversation. |
object | string | Always "response". |
created_at | number | Unix timestamp of when the response was generated. |
status | string | Always "completed" for a successful non-streaming response. |
model | string | The model used to generate the response. |
output | array | Array containing the generated message. Always contains exactly one item. |
output[0].role | string | Always "assistant". |
output[0].content[0].text | string | The generated regulatory answer. |
output_text | string | Convenience field with the same text as output[0].content[0].text. |
usage | object | Token usage statistics, same shape as on Chat Completions. |
conversationId | string | Identifier 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:
| Event | Description |
|---|---|
response.created | Emitted once, immediately, with status: "in_progress". |
response.in_progress | Emitted once, immediately after response.created. |
response.output_text.delta | Emitted for each generated text chunk. delta contains the incremental text. |
response.output_text.done | Emitted once, with the full generated text. |
response.completed | Emitted once, with the same full response object described in Response Fields above, under response. |
response.error | Emitted 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 Code | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters, unsupported tools/modalities, or non-text input. |
401 | Unauthorized — missing, invalid, or malformed API key. |
402 | Payment required — insufficient token balance or no remaining questions on subscription. |
403 | Forbidden — no active subscription found for an app-scoped key. |
412 | Precondition failed — app-scoped key used without the required X-Raiana- prefix on user. |
500 | Internal server error. Contact support if this persists. |
502 | Upstream error — the Raiana backend encountered an error processing your request. |
504 | Timeout waiting for a streamed response to complete. |
