Skip to content

API Overview

Quick start for Anthropic Messages, OpenAI Chat Completions, Responses, and metadata endpoints.

No current prepared translation is available. The English source is shown without machine translation.

Model Gate provides one authenticated gateway for Anthropic- and OpenAI-compatible clients.

Base URLs

Anthropic-compatible: https://api.model-gate.com
OpenAI-compatible:    https://api.model-gate.com/v1

OpenAI Chat Completions request

curl https://api.model-gate.com/v1/chat/completions \
  -H "Authorization: Bearer mg_live_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"ch-47","messages":[{"role":"user","content":"Hello"}]}'

OpenAI Chat Completions response

{
  "id": "chatcmpl_example",
  "object": "chat.completion",
  "model": "claude-opus-4.7",
  "choices": [{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}],
  "usage": {"prompt_tokens":8,"completion_tokens":3,"total_tokens":11}
}

Anthropic Messages request

curl https://api.model-gate.com/v1/messages \
  -H "x-api-key: mg_live_..." \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4.6","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}'

Anthropic Messages response

{
  "id": "msg_example",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-4.6",
  "content": [{"type":"text","text":"Hello!"}],
  "usage": {"input_tokens":8,"output_tokens":3}
}

Models and personalized prices

GET /v1/models returns canonical model records containing only id, object, created and owned_by. Prices, aliases, capabilities and token limits are not exposed by this minimal response; see Models and prices in the account. The expanded format is temporarily disabled from 12.0.0.

Settlement

The account balance is debited by cost. API-key and group resettable limits are incremented by usage_cost. These values can differ because each key or group can select user_price or official_price and a multiplier.

Images and configured capabilities

The account Models and prices page contains descriptive capabilities and applicable token or media tariffs; the minimal API model catalog does not contain them. For generation or editing, use the Images catalog and quote for your selected settings; the Images badge is not a price. Start with Playground Images and the endpoint index. Cost recording and balance updates are separate: successful creation or accounting_recorded does not mean your balance has already changed. For recordings, use Playground Audio and the transcription API. Audio is separate from text chat and Images.

Russia reserve endpoint (Individual): use https://ruapi.model-gate.com manually with the same API key, tariffs and request accounting. After a timeout, check Usage before submitting another potentially paid request. It is not automatic failover.