Disclosure: I work on InterOdin, the API used in this tutorial. The pattern works for any OpenAI-compatible provider.
Security scripts often hit a wall with general-purpose models: a request to explain a malware sample from your own incident, or to draft a detection rule, comes back as a refusal. If your code already uses the official OpenAI SDK, you can switch the model behind it with a base URL and a key. This walkthrough uses Odin v1 through InterOdin, which serves both Chat Completions and Responses.
Install
pip install openai # Python npm install openai # JavaScript / TypeScript Configure the client
Python:
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) TypeScript:
import OpenAI from 'openai' const client = new OpenAI({ baseURL: 'https://api.interodin.com/v1', apiKey: process.env.INTERODIN_API_KEY, }) const completion = await client.chat.completions.create({ model: 'odin-v1', messages: [{ role: 'user', content: 'Say hello in Romanian.' }], }) console.log(completion.choices[0]?.message.content) No code changes at all? Both SDKs read these environment variables:
export OPENAI_BASE_URL="https://api.interodin.com/v1" export OPENAI_API_KEY="io-sk-your-key" Responses API
response = client.responses.create(model="odin-v1", input="Say hello in Romanian.", store=False) print(response.output_text) Responses is stateless here: send the full conversation in input on each turn.
What doesn't carry over
- Images and files. Odin v1 is text-only. Images are replaced by a text note; a file in the newest message fails with
400 unsupported_content. - Hosted tools (file search, code interpreter, MCP) are removed from the request. Your own function tools run. Web search works on the Responses API only, billed per search.
-
previous_response_id,conversationandbackground: truereturn400 unsupported_parameter, and stored responses can't be fetched, because nothing is stored.
Errors
The SDKs raise their usual exceptions: AuthenticationError for 401, RateLimitError for 429, and APIStatusError / APIError subclasses for the rest. Read the code field to tell insufficient_credits (402) apart from other errors. 429 and 5xx are retried automatically.
Billing is prepaid credits per token, with no subscription, and API prompts and completions are not stored. Fewer refusals does not mean no rules: the Acceptable Use Policy forbids illegal and harmful uses, so use it on systems and data you are authorised to work on.
The maintained version of this guide lives in the docs: https://docs.interodin.com/en/integrations/openai-sdk

