Migrate from Anthropic
Convert Messages, authentication, responses, streaming and tools to Chat Completions.
Updated on Aug 09, 2026
The Anthropic Messages API and HINOW Chat Completions use different contracts. The recommended migration is to replace the anthropic client with the openai client configured with the HINOW base URL, or to call https://api.hinow.ai/v1/chat/completions directly.
It is not just changing the URL
Authentication, the system prompt, the tool structure, content blocks, streaming and the response format all have to be converted.
| Anthropic Messages | HINOW Chat Completions |
|---|---|
x-api-key and anthropic-version | Authorization: Bearer $HINOW_API_KEY |
POST https://api.anthropic.com/v1/messages | POST https://api.hinow.ai/v1/chat/completions |
system: "..." at the top | messages[0] with role: "system" |
Anthropic model | hinow/himax, hinow/hinova or hinow/higenesis |
response.content[0].text | response.choices[0].message.content |
stop_reason | finish_reason |
usage.input_tokens | usage.prompt_tokens |
usage.output_tokens | usage.completion_tokens |
from anthropic import Anthropic
import os
client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
resposta = client.messages.create(
model="SEU_MODELO_ANTHROPIC",
max_tokens=500,
system="Responda com objetividade.",
messages=[{"role": "user", "content": "Resuma este texto."}],
)
print(resposta.content[0].text)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",
max_tokens=500,
messages=[
{"role": "system", "content": "Responda com objetividade."},
{"role": "user", "content": "Resuma este texto."},
],
)
print(resposta.choices[0].message.content)| Anthropic | HINOW |
|---|---|
tools[].name and tools[].input_schema | tools[].function.name and tools[].function.parameters |
tool_use response block | message.tool_calls[] |
tool_result input block | Message with role: "tool" and tool_call_id |
| Arguments as an object | function.arguments as serialized JSON; parse and validate it |
Do not reuse the Anthropic event parser. On HINOW, read the Chat Completions chunks and accumulate choices[0].delta.content; function calls arrive in deltas of their own.
For images, convert Anthropic's source blocks to the image_url format documented by HINOW and choose a model whose vision modality is published in List models.
- Replace the package and the environment variable holding the key.
- Convert the system prompt into a
systemmessage. - Update the model, the call and how the response is read.
- Rewrite the streaming parser.
- Convert the tools and validate every argument before running it.
- Review images and other content blocks.
- Run behavior, error and cost tests before rolling out.
Source format references: Anthropic Messages API and Anthropic SDKs.
Validate the HINOW integration
Use the technical reference and the public models as the contract for the new code.

