Docs

OpenAI SDK

Use the official OpenAI SDKs for Python and JavaScript with InterOdin.

The official OpenAI SDKs work with only a base URL change (see Not supported for the limits). Set the base URL to https://api.interodin.com/v1 and use your io-sk- key. Both Chat Completions and Responses are available.

Install

pip install openai

Configure

Pass the base URL and key to the client:

import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.interodin.com/v1",
    api_key=os.environ["INTERODIN_API_KEY"],
)

completion = client.chat.completions.create(
    model="odin-v1",
    messages=[{"role": "user", "content": "Say hello in Romanian."}],
)
print(completion.choices[0].message.content)

Or configure it through the environment variables both SDKs read, without touching code:

export OPENAI_BASE_URL="https://api.interodin.com/v1"
export OPENAI_API_KEY="io-sk-your-key"

Responses API

import os

from openai import OpenAI

client = OpenAI(base_url="https://api.interodin.com/v1", api_key=os.environ["INTERODIN_API_KEY"])

response = client.responses.create(model="odin-v1", input="Say hello in Romanian.", store=False)
print(response.output_text)

Responses is stateless here. See Responses for how to keep a multi-turn conversation.

Extra fields and headers

Some fields aren't in the SDK's types. Use extra_body in Python, or a type assertion in TypeScript. Send the cache routing header per request:

import os

from openai import OpenAI

client = OpenAI(base_url="https://api.interodin.com/v1", api_key=os.environ["INTERODIN_API_KEY"])

completion = client.chat.completions.create(
    model="odin-v1",
    messages=[{"role": "user", "content": "Is 1,000,003 prime?"}],
    reasoning_effort="low",
    extra_body={"include_reasoning": False},
    extra_headers={"x-interodin-session-id": "conv_7d2a9f"},
)
print(completion.choices[0].message.content)

Not supported

These OpenAI features don't work against InterOdin:

  • Image and file inputs in the newest message fail with 400: image_input_not_supported for images (Odin v1 is text-only) and unsupported_content for files. Ones in tool output or earlier turns are replaced by a text note.
  • Hosted tools (file search, code interpreter, MCP) are silently removed from the request. Only your own function and custom tools run. Web search runs on the Responses API only, billed per search (see Web search), and is removed on Chat Completions.
  • previous_response_id, conversation and background: true fail with 400 unsupported_parameter. Send the full conversation in input instead.
  • Fetching or deleting a stored response (GET / DELETE /v1/responses/{id}) returns 404, because nothing is stored.

Errors

API errors raise the SDK's usual exceptions: AuthenticationError for 401, RateLimitError for 429, and other subclasses of APIStatusError (Python) or APIError (TypeScript) for everything else. Read the code field (or the x-interodin-error-code response header) to tell, for example, insufficient_credits (402) apart from other errors. The SDKs retry 429 and 5xx responses automatically. See Errors and rate limits.

More: Chat Completions guide.

On this page