Docs
Getting Started

Quickstart

Make a successful Qufas Chat Completions request in five minutes.

Quickstart

Complete these steps before sending your first request to Qufas AI's OpenAI SDK-compatible Chat Completions API.

  1. Create an account and sign in.
  2. Open Dashboard → Credits, add credits, and confirm that your balance is greater than $0. Inference requires a positive prepaid balance; no free or promotional credit is assumed.
  3. Open Dashboard → API Keys and create an API key. Copy the complete key when it is shown; later the dashboard displays only its prefix.
  4. Keep the key in server-side environment variables. Never expose it in browser code or commit it to source control.

Choose a current model

This quickstart currently uses kimi-k2.7-code. Use GET /v1/models for enabled official model IDs. Image examples are templates: replace <enabled-image-model-id> only after an image model is enabled. Qufas never silently remaps a model ID to another version. Confirm that it is enabled and review its current rate in Models & Pricing.

cURL
1curl https://qufas-ai.vercel.app/v1/models \2  -H "Authorization: Bearer $QUFAS_API_KEY"

First request

Choose cURL, Python, or Node.js / TypeScript. Each tab setsQUFAS_API_KEY and calls the same Chat Completions endpoint.

Language

cURL

Best for a first terminal request and checking credentials.

How it works

Send a direct HTTP request without installing an SDK.

Set QUFAS_API_KEY, use https://qufas-ai.vercel.app/v1, and send requests to /chat/completions.

Environment
1export QUFAS_API_KEY="qf_sk_your_api_key"
cURL
1curl https://qufas-ai.vercel.app/v1/chat/completions \2  -H "Authorization: Bearer $QUFAS_API_KEY" \3  -H "Content-Type: application/json" \4  -d '{5    "model": "kimi-k2.7-code",6    "messages": [7      {8        "role": "user",9        "content": "Hello!"10      }11    ]12  }'

Example response

JSON
1{2  "id": "chatcmpl_xxxxxxxxx",3  "object": "chat.completion",4  "created": 1750000000,5  "model": "kimi-k2.7-code",6  "choices": [7    {8      "index": 0,9      "message": {10        "role": "assistant",11        "content": "..."12      },13      "finish_reason": "stop"14    }15  ],16  "usage": {17    "prompt_tokens": 18,18    "completion_tokens": 26,19    "total_tokens": 4420  }21}

First-request troubleshooting

HTTPCodeWhat to do
401invalid_api_keyCheck that QUFAS_API_KEY contains an active qf_sk_ key and that the Bearer header is present.
402insufficient_balanceOpen Dashboard, add credits, and confirm that the balance is greater than $0.
404model_not_foundCall GET /v1/models again and use an ID returned for this API key.
503model_unavailableThe model is not currently callable. Query GET /v1/models and choose an available ID; Qufas does not silently switch model versions.
429rate_limit_exceededHonor Retry-After and retry with bounded exponential backoff.

Save the x-qufas-request-id response header when asking for help. See Request IDs & Debugging and the Error Codes reference.

Was this page helpful?