Back to OmniaKey

Anthropic

en-api-anthropic-native.md

latest1.5 KB
Original Source

Use the bare API host for Anthropic-native tools:

https://api.omniakey.com

Claude Code and the Anthropic SDK append /v1/messages automatically.

Messages

POST /v1/messages is the Anthropic Messages endpoint. It is the native path for Claude models and the protocol Claude Code expects. Use Claude model ids on this surface; use the OpenAI-compatible or Gemini-native surfaces for GPT and Gemini.

cURL

Python

curl https://api.omniakey.com/v1/messages \
  -H "Authorization: Bearer your-omniakey-api-key" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Refactor this function for readability."}]
  }'
from anthropic import Anthropic

client = Anthropic(
    api_key="your-omniakey-api-key",
    base_url="https://api.omniakey.com",
)

message = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Refactor this function for readability."}],
)

print(message.content[0].text)

Claude Code

Claude Code uses the same Anthropic-native base URL:

export ANTHROPIC_BASE_URL="https://api.omniakey.com"
export ANTHROPIC_AUTH_TOKEN="your-omniakey-api-key"
claude

See Claude Code API Key for the full setup.

OpenAI-compatible APIGemini-native API

⌘I