Skip to content

Endpoints

Kyvalt serves the request formats of OpenAI and Anthropic under one base URL: https://api.kyvalt.com/v1. Pick the format your code already uses. Request bodies follow the provider's own reference, so their documentation applies field for field.

Method and pathFormat
POST /v1/chat/completionsOpenAI Chat Completions
POST /v1/messagesAnthropic Messages
POST /v1/responsesOpenAI Responses
POST /v1/completionsOpenAI legacy Completions
GET /v1/modelsModel list, see Models

Discount floors, price caps and per-token billing apply to all four POST endpoints above. Other paths that OpenAI offers, such as embeddings, images and audio, are not part of the Kyvalt marketplace.

Chat Completions

curl
curl https://api.kyvalt.com/v1/chat/completions \
  -H "Authorization: Bearer $KYVALT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "max_tokens": 200,
    "messages": [
      {"role": "system", "content": "Answer in one sentence."},
      {"role": "user", "content": "What is a token?"}
    ]
  }'
response
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "deepseek-v4-pro",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "A token is ..." },
    "finish_reason": "stop"
  }],
  "usage": { "prompt_tokens": 24, "completion_tokens": 18, "total_tokens": 42 }
}

Messages

Use this with the Anthropic SDKs, setting the base URL to https://api.kyvalt.com without /v1. The key goes in x-api-key or Authorization: Bearer.

curl
curl https://api.kyvalt.com/v1/messages \
  -H "x-api-key: $KYVALT_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "max_tokens": 200,
    "messages": [{"role": "user", "content": "What is a token?"}]
  }'

Reasoning models may return a thinking block before the text block. Read the blocks by type rather than taking the first one.

Responses

curl
curl https://api.kyvalt.com/v1/responses \
  -H "Authorization: Bearer $KYVALT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "max_output_tokens": 200,
    "input": "What is a token?"
  }'

Kyvalt request options

These are optional and work on every POST endpoint above. Discount floor and price cap explains each one.

OptionWhereEffect
X-Min-Discount: 40HeaderOnly use offers at least 40% below list price.
/min40/v1/...URL pathSame as the header, for clients that cannot set headers.
"max_price_per_1m": 2.5JSON bodyOnly use offers whose output price is at most $2.50 per 1M tokens.

Response headers

Every response, successful or not, has an x-request-id header. The same ID appears in your Usage logs and inside error bodies. Rate-limit and capacity errors also carry retry-after in seconds.