Skip to content

API reference

One endpoint set, compatible with OpenAI-style clients. Send a request without a model field and the gateway routes it; add a model field on a premium plan to override.

Base URLhttps://api.vechgate.dev/v1

01 / request and response

A standard request, start to finish

No model field means automatic routing. The response carries the actual model and the routing metadata.

Example requestPOST /v1/chat/completions
curl https://api.vechgate.dev/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      { "role": "user", "content": "Write a Python function to sort a list." }
    ]
  }'
Example responsegateway: auto
{
  "id": "chatcmpl_xxxxxxxxx",
  "object": "chat.completion",
  "created": 1791028800,
  "model": "provider/actual-model",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Here is the explanation..." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 120,
    "completion_tokens": 240,
    "total_tokens": 360
  },
  "gateway": {
    "routing": "auto",
    "provider": "provider-name",
    "latency_ms": 850,
    "premium": false
  }
}

Gateway metadata can be disabled for strict client compatibility (PRD section 5.3).

02 / premium override

Request one specific model

The model field is validated against the catalog, priced before execution, and billed as a fixed surcharge per request.

Override request
curl https://api.vechgate.dev/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "provider/model-name",
    "messages": [
      { "role": "user", "content": "Analyze this complex codebase." }
    ]
  }'

A request without the entitlement is rejected with a clear error, never routed to a different model.

03 / endpoints

What the gateway exposes

Vechgate API endpoints
MethodPathPurpose
POST/v1/chat/completionsMain inference endpoint
GET/v1/modelsAvailable capabilities and permitted overrides
POST/v1/embeddingsGenerate embeddings
POST/v1/responsesUnified response interface, if supported
GET/v1/usageRetrieve API usage
GET/v1/balanceRetrieve account balance
GET/v1/healthGateway health
GET/v1/pricingRetrieve pricing information

04 / errors

How failures are reported

Vechgate API failure responses
ResponseWhen
HTTP 401Invalid API key
HTTP 429RPM exceeded, returns retry metadata
HTTP 400Unsupported capability
HTTP 503All eligible providers unavailable
HTTP 402Insufficient balance, rejected before execution
ErrorPremium model not allowed, explicit entitlement error

Failed requests follow a documented policy on whether they count against RPM. Streaming errors after headers are sent are reported in the stream error format.

Create a key and send the first request

The free tier includes 5 requests per minute against the same endpoint used in production.