Docs
API referenceChat completions

Create chat completion

POST
/v1/chat/completions

Generates the next assistant message. With stream: true the reply is sent as server-sent events: each data: line is a ChatCompletionChunk, the last chunk carries usage, and the stream ends with data: [DONE].

Authorization

headerAuthorizationBearer <token>

Your API key: Authorization: Bearer io-sk-…. If a request also sends x-api-key, x-api-key wins.

Header Parameters

x-interodin-session-id?string

Optional prompt-cache routing hint, honoured on every generation endpoint (including count_tokens). Send the same opaque value (for example a conversation id, at most 128 characters recommended) on every request of one conversation. Never put prompts, personal data or secrets in it.

Request Body

application/json
  1. body
model*string

Model id, for example odin-v1.

messages*array<>
Items1 <= items
stream?boolean

Stream the reply as server-sent events.

Defaultfalse
stream_options?
max_tokens?integer

Clamped to the model maximum. 0 or less returns 400.

Range1 <= value
max_completion_tokens?integer

Alias of max_tokens. 0 or less returns 400.

Range1 <= value
temperature?number
Range0 <= value <= 2
top_p?number
Range0 <= value <= 1
stop?string|array<string>
seed?integer
presence_penalty?number
Range-2 <= value <= 2
frequency_penalty?number
Range-2 <= value <= 2
tools?array<|||>

Function tools and custom tools. Any other tool type is removed from the request without an error, as are web_search_options and a tool_choice that names a removed tool.

store?boolean

Ignored: nothing is stored. Always sent as false.

metadata?

Ignored and not forwarded.

tool_choice?||
parallel_tool_calls?boolean
response_format?
reasoning_effort?string

Reasoning is on or off, with no levels. none turns it off on Odin Flash; it does not on Odin v1. The other values are accepted and change nothing.

Value in"none""minimal""low""medium""high""xhigh""max"
include_reasoning?boolean

Set false to omit reasoning from the reply. Reasoning tokens are still billed as output.

prompt_cache_key?string

Prompt-cache routing hint. Same value for every request of one conversation. Forwarded only as a hash specific to your organization; not stored. A string of at most 1024 characters is accepted, null removes the field and any other value returns 400 invalid_request.

Lengthlength <= 1024
user?string

Your end-user id. Forwarded only as a hash specific to your organization; not stored. A string of at most 1024 characters is accepted, null removes the field and any other value returns 400 invalid_request.

Lengthlength <= 1024
safety_identifier?string

A stable identifier for the end user, for abuse detection. Forwarded only as a hash specific to your organization; not stored. A string of at most 1024 characters is accepted, null removes the field and any other value returns 400 invalid_request.

Lengthlength <= 1024

Response Body

A chat completion, or an event stream when stream is true.

  1. response
id*string
object*string
created*integer
model*PublicModelId

A public InterOdin model id, for example odin-v1.

Match^odin-[a-z0-9.-]+$
choices*array<>
usage?
curl -X POST 'https://api.interodin.com/v1/chat/completions' \  -H 'Content-Type: application/json' \  -d '{  "model": "odin-v1",  "messages": [    {      "role": "user",      "content": "Say hello in Romanian."    }  ]}'
{  "id": "string",  "object": "chat.completion",  "created": 0,  "model": "odin-v1",  "choices": [    {      "index": 0,      "message": {        "role": "assistant",        "content": "string",        "reasoning": "string",        "refusal": "string",        "tool_calls": [          {            "id": "string",            "type": "function",            "function": {              "name": "string",              "arguments": "string"            }          }        ]      },      "finish_reason": "stop"    }  ],  "usage": {    "prompt_tokens": 0,    "completion_tokens": 0,    "total_tokens": 0,    "prompt_tokens_details": {      "cached_tokens": 0    },    "completion_tokens_details": {      "reasoning_tokens": 0    }  }}