Skip to content

Claude Chat ​

Anthropic Claude series models support both OpenAI-compatible format and Anthropic native format.

Supported Models ​

ModelPositioning
claude-opus-5Latest flagship, strongest reasoning
claude-opus-4-8Opus 4.8
claude-sonnet-5Latest Sonnet, balanced performance and speed
claude-sonnet-4-6Sonnet 4.6
claude-sonnet-4-6-thinkingWith thinking output
claude-haiku-4-5Lightweight and fast, lower cost
claude-fable-5Creative writing specialized

More historical versions (Opus 4.x / Sonnet 4.5, etc.) are available in the "Model Hub" section of the console.

Endpoint ​

POST $URL/v1/chat/completions

Request Example ​

bash
curl $URL/v1/chat/completions \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [
      {"role": "user", "content": "Write a Python quicksort"}
    ]
  }'
python
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="$URL/v1")
resp = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": "Write a Python quicksort"}],
)
print(resp.choices[0].message.content)
ts
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: process.env.YOUR_API_KEY,
  baseURL: '$URL/v1',
})
const resp = await client.chat.completions.create({
  model: 'claude-sonnet-5',
  messages: [{ role: 'user', content: 'Write a Python quicksort' }],
})
console.log(resp.choices[0].message.content)

Method 2: Anthropic Native Format ​

If you already have code based on the Anthropic SDK, you can use the native Messages API directly:

Endpoint ​

POST $URL/v1/messages

Request Example ​

bash
curl $URL/v1/messages \
  -H "x-api-key: $YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Write a Python quicksort"}
    ]
  }'
python
import anthropic

client = anthropic.Anthropic(
    api_key="YOUR_API_KEY",
    base_url="$URL",
)

message = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Write a Python quicksort"}],
)
print(message.content[0].text)
ts
import Anthropic from '@anthropic-ai/sdk'

const client = new Anthropic({
  apiKey: process.env.YOUR_API_KEY,
  baseURL: '$URL',
})

const message = await client.messages.create({
  model: 'claude-sonnet-5',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Write a Python quicksort' }],
})
console.log(message.content[0].text)

Native Format Highlights ​

DifferenceAnthropic NativeOpenAI-Compatible
Auth headerx-api-key: <KEY> (also compatible with Authorization: Bearer)Authorization: Bearer <KEY>
max_tokensRequiredOptional
system promptTop-level system fieldrole: system inside messages
Response structurecontent is a block arraychoices[0].message

Recommendation ​

ScenarioRecommended Format
New project / multi-model unified managementOpenAI-compatible format
Existing Anthropic SDK code, Claude Code and other native toolsAnthropic native format
Need extended thinking and other Claude-specific parametersAnthropic native format

© 2026 Euno AI. All rights reserved.