Skip to content

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.

Main mapping

Anthropic MessagesHINOW Chat Completions
x-api-key and anthropic-versionAuthorization: Bearer $HINOW_API_KEY
POST https://api.anthropic.com/v1/messagesPOST https://api.hinow.ai/v1/chat/completions
system: "..." at the topmessages[0] with role: "system"
Anthropic modelhinow/himax, hinow/hinova or hinow/higenesis
response.content[0].textresponse.choices[0].message.content
stop_reasonfinish_reason
usage.input_tokensusage.prompt_tokens
usage.output_tokensusage.completion_tokens

Python: before and after

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)

Tools

AnthropicHINOW
tools[].name and tools[].input_schematools[].function.name and tools[].function.parameters
tool_use response blockmessage.tool_calls[]
tool_result input blockMessage with role: "tool" and tool_call_id
Arguments as an objectfunction.arguments as serialized JSON; parse and validate it

Streaming and multimodal content

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.

Checklist

  • Replace the package and the environment variable holding the key.
  • Convert the system prompt into a system message.
  • 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.

Was this page helpful?