Migrate from OpenAI
Keep the SDK on Chat Completions or adapt an integration based on the Responses API.
Updated on Aug 09, 2026
If the application uses Chat Completions, the migration is usually small: keep the openai package, swap the key, configure the HINOW base URL and choose a HINOW model. If it uses the Responses API, adapt the call to Chat Completions, because the input and output formats are different.
What changes in Chat Completions
Base URL, key and model identifier. Parameters and features should be limited to those that appear in the HINOW documentation and validated with your tests.
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
resposta = client.chat.completions.create(
model="SEU_MODELO_OPENAI",
messages=[{"role": "user", "content": "Resuma este texto."}],
)
print(resposta.choices[0].message.content)from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ["HINOW_API_KEY"],
base_url="https://api.hinow.ai/v1",
)
resposta = client.chat.completions.create(
model="hinow/hinova",
messages=[{"role": "user", "content": "Resuma este texto."}],
)
print(resposta.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const resposta = await client.chat.completions.create({
model: 'SEU_MODELO_OPENAI',
messages: [{ role: 'user', content: 'Resuma este texto.' }],
});
console.log(resposta.choices[0].message.content);import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.HINOW_API_KEY,
baseURL: 'https://api.hinow.ai/v1',
});
const resposta = await client.chat.completions.create({
model: 'hinow/hinova',
messages: [{ role: 'user', content: 'Resuma este texto.' }],
});
console.log(resposta.choices[0].message.content);| Responses API | Chat Completions on HINOW |
|---|---|
client.responses.create(...) | client.chat.completions.create(...) |
input: "..." | messages: [{role: "user", content: "..."}] |
instructions: "..." | Message with role: "system" |
response.output_text | response.choices[0].message.content |
| Responses API streaming events | Chat Completions chunks in choices[0].delta |
| OpenAI built-in tools | Functions declared by the application in tools |
Do not assume every feature is compatible
The Responses API, hosted tools, files, conversation state and structured formats may require a different implementation. Use only endpoints and fields documented by HINOW.
curl https://api.hinow.ai/v1/chat/completions \
-H "Authorization: Bearer $HINOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "hinow/hinova",
"messages": [{"role": "user", "content": "Responda apenas: migração concluída"}]
}'- Replace
OPENAI_API_KEYwithHINOW_API_KEY. - Set
https://api.hinow.ai/v1as the base URL in the SDK. - Replace the model identifier.
- Confirm the parameters, JSON, tools, images and streaming used by the application.
- Update how the response is read if you are leaving the Responses API.
- Compare results against your evaluation set before the final cutover.
Source format references: OpenAI Chat Completions and OpenAI quickstart.
Choose the target model
Compare capabilities and pricing before running the evaluation.

