Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kymaapi.com/llms.txt

Use this file to discover all available pages before exploring further.

Basic request

curl https://kymaapi.com/v1/chat/completions \
  -H "Authorization: Bearer ky-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-3.6-plus",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

With system prompt

curl https://kymaapi.com/v1/chat/completions \
  -H "Authorization: Bearer ky-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-3.6-plus",
    "messages": [
      {"role": "system", "content": "You are a pirate."},
      {"role": "user", "content": "Tell me about the weather."}
    ]
  }'

Streaming

curl https://kymaapi.com/v1/chat/completions \
  -H "Authorization: Bearer ky-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-3.6-plus",
    "messages": [{"role": "user", "content": "Write a poem"}],
    "stream": true
  }'

List models

curl https://kymaapi.com/v1/models

Check rate limits

curl https://kymaapi.com/v1/auth/limits \
  -H "Authorization: Bearer ky-your-api-key"

Generating images and videos

Image and video models use a separate async endpoint. POST to /v1/images/generations or /v1/videos/generations, get a job_id back, poll /v1/jobs/{id} until status is succeeded.
JOB=$(curl -sS -X POST https://kymaapi.com/v1/videos/generations \
  -H "Authorization: Bearer ky-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"kling-3-pro","prompt":"A drone shot over a misty mountain range at sunrise","duration":5}' \
  | jq -r '.id')

# Poll every 3s until done
while true; do
  RESP=$(curl -sS https://kymaapi.com/v1/jobs/$JOB \
    -H "Authorization: Bearer ky-your-api-key")
  STATUS=$(echo "$RESP" | jq -r '.status')
  [ "$STATUS" = "succeeded" ] && break
  case "$STATUS" in failed|expired|refunded) echo "$RESP"; exit 1;; esac
  sleep 3
done

echo "$RESP" | jq -r '.output.url'
Same pattern for /v1/images/generations: swap the model (flux-1.1-ultra, ideogram-v3, recraft-v3, flux-kontext-pro) and omit duration.