checking gateway…

Free API Router

A secure API gateway for AI models. You only ever talk to your API — your keys stay server-side and are never exposed to the models or third parties.

Quick start Available models Endpoints Check key usage

Quick start

The public contract is OpenAI-compatible. Point any OpenAI SDK at /v1 and authenticate with your API key.

curl https://pkay-api-freee.up.railway.app/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Use model auto to let the gateway pick the best available model for your request.

Authentication

Every request is authenticated with a user API key (pkay_…) sent in the Authorization: Bearer header. Keys are stored only as salted hashes — the raw key is shown once when it is issued to you, so save it immediately.

If you get a 401 or 403 error

These are the two auth errors you may hit. The response body always tells you the exact reason — here is how to read and fix each one.

401 — Unauthorized. Your request was rejected because the API key could not be verified. This happens when:
  • The Authorization: Bearer header is missing entirely.
  • The key is typed/embedded incorrectly (extra spaces, copied prefix only, or truncated).
  • The key has been revoked by an admin.
  • The key has expired (it had an expiry date set).
How to fix: re-check the full pkay_… string, make sure it is sent exactly in the Authorization: Bearer header, and — if it was revoked or expired — ask for a fresh key. You can verify a key is still valid with the key usage checker: a 401 there means the key is dead.
403 — Forbidden. Your key was accepted, but it does not have permission for the operation you tried. This happens when:
  • You call /v1/chat/completions but the key lacks the chat permission.
  • You call /v1/embeddings but the key lacks the embeddings permission.
How to fix: the key itself is fine — it just needs the right permission. Ask an admin to grant the missing permission (e.g. chat / embeddings) to that key. A 403 is never caused by a wrong password or expiry.
Still stuck? A 404 means the route or model name was not found (check spelling / use auto), and any other error is a provider or gateway failure on our side — retry shortly. Use the key usage checker to see exactly which responses your key has been getting.

Endpoints

MethodPathDescription
GET/healthzHealth check.
GET/v1/modelsList the models available to your key.
POST/v1/chat/completionsOpenAI-compatible chat completion (supports stream:true).
POST/v1/embeddingsOpenAI-compatible embeddings.

Check your API key usage

Want to know which models your key has used, on what dates, how many tokens it has spent, and whether it has hit 401, 403, 404, or other errors? Call the self-service usage endpoint below — authenticated with your own key, so you only ever see your own data.

curl https://pkay-api-freee.up.railway.app/v1/key/usage \
   -H "Authorization: Bearer YOUR_API_KEY"
FieldMeaning
modelsPer-model breakdown: request count, prompt/completion/total tokens, and first/last used timestamps.
by_dateTotal requests and tokens grouped by calendar date (UTC).
status_breakdownCounts of ok, error, and aborted responses.
http_breakdownCounts by HTTP status — including 401 (missing/invalid/expired key), 403 (missing permission), and 404 (unknown route/model).
error_breakdownCounts by internal error type (e.g. provider_error, rate_limit_error).
401 means the key was missing, invalid, revoked, or expired. 403 means the key lacks the required permission (e.g. chat or embeddings). 404 means the route or model name was not found. Any other error is a provider or gateway failure.

Available models

Send "model" as the exact model name shown below. The gateway routes each request to the best available backend automatically — you never need to know (or trust) which upstream service is serving it. Use auto to let the gateway pick the best available model.

Kimi-K2.6
DeepSeek-V4-Flash
MiniMax-M3
claude-opus-4-8
claude-opus-5
deepseek-v4-pro
gpt-5.6-sol
Kimi-K2.6-azure
llama-4-maverick
gemma-4-26b
glm-5.2
claudeai
codexai
gemini-3.6-flash
claude-sonnet-5
kimi-k3
minimax-m3
claude-haiku-4.5
Your API key is stored only as a salted hash and the raw key is shown once. Upstream provider keys live encrypted on the server and are never exposed to clients.

Try it

idle
Response will appear here…