Yaha AI Gateway
SDK Guides

curl

Call the Yaha gateway with raw HTTP requests.

Use curl for a quick smoke test or to verify your yaha.* key and model allowlist.

Chat completion

curl https://gateway.yahagateway.io/v1/chat/completions \
  -H "Authorization: Bearer yaha.YOUR_PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Streaming

Add "stream": true to the JSON body. The response is Server-Sent Events (text/event-stream).

curl -N https://gateway.yahagateway.io/v1/chat/completions \
  -H "Authorization: Bearer yaha.YOUR_PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "stream": true,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

List models

curl https://gateway.yahagateway.io/v1/models \
  -H "Authorization: Bearer yaha.YOUR_PROJECT_KEY"

Notes

  • Replace yaha.YOUR_PROJECT_KEY with your full project key from the console.
  • The gateway implements OpenAI-compatible /v1/* endpoints.
  • See Prerequisites if you get 403 or model errors.
  • See Language examples for additional languages and a reusable integration prompt.

On this page