Docs

gyrent API

An OpenAI-compatible gateway to every model gyrent can price. Point an existing client at it and change one line. You are billed what the model costs — no markup, settled from your USDC balance.

New here? Bring your own key — chat & build free, no deposit →

Gateway

The base URL is https://api.gyrent.xyz/v1. Every endpoint follows OpenAI’s chat-completions schema, so the official SDKs work unmodified — the only change is base_url.

Base URLhttps://api.gyrent.xyz/v1

Create a key in Settings → Gateway API keys. It is shown once and stored only as a hash, so it cannot be recovered — if you lose it, revoke it and make another.

Authentication

Pass your key as a bearer token. Keys look like gyr_ and carry your balance — treat one like a password, keep it server-side, and never ship it to a browser.

Authorization: Bearer gyr_your_key_here

Cookies do not authenticate here. The key is the only credential /v1 accepts.

Keys issued before the rename start with fgnt_…. They keep working — nothing was revoked and there is no need to rotate. New keys are issued as gyr_.

Models

GET /v1/models lists everything you can call right now, with its price per million tokens. The list is live: a model with no published price never appears, and never runs — we will not spend your money at a rate we cannot state.

curl https://api.gyrent.xyz/v1/models \
  -H "Authorization: Bearer $GYRENT_API_KEY"

Use "model": "auto" to let the router choose the cheapest capable model, or name one exactly as provider/model. Bring your own provider key in Settings and its models appear here too — including Claude, which is BYOK-only.

BYOK capabilities

Bring your own provider key in Settingsand the router runs your calls on it — free, at your provider’s own rate. What a key unlocks depends on the models that provider offers, so this table is generated from the live registry: chat and parse are text; vision needs a model that can see; planner needs tool-calling for the agent loop.

Loading capabilities…

A gap here is not an error — it is the honest answer that this key cannot do that task, and the API returns a 402 naming what is missing rather than quietly serving a weaker model.

Chat completions

POST /v1/chat/completionsmessages, model (default auto), stream, max_tokens, temperature.

curl https://api.gyrent.xyz/v1/chat/completions \
  -H "Authorization: Bearer $GYRENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "groq/llama-3.3-70b-versatile",
    "messages": [{"role": "user", "content": "Say hello"}]
  }'

The response is OpenAI’s, plus what the call actually cost:

{
  "id": "chatcmpl-7c6vznib48",
  "object": "chat.completion",
  "created": 1784231135,
  "model": "groq/llama-3.3-70b-versatile",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello!" },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 40,
    "completion_tokens": 2,
    "total_tokens": 42
  },
  "forgent": {
    "cost_micro_usd": 24,
    "byok": false
  }
}

Streaming

Set stream: true for server-sent events. Chunks arrive as chat.completion.chunk, the final one carries usage, and the stream ends with data: [DONE].

curl -N https://api.gyrent.xyz/v1/chat/completions \
  -H "Authorization: Bearer $GYRENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Say hello"}],
    "stream": true
  }'

Hang up and we stop the generation upstream immediately — you are not billed for tokens you did not receive.

Errors

Errors use OpenAI’s envelope, so existing retry logic reads them unchanged.

{
  "error": {
    "message": "Balance is $0.0040; at least $0.01 is needed to start a call.",
    "type": "insufficient_quota",
    "code": "insufficient_balance"
  }
}
statuscodewhen
401invalid_api_keyKey is missing, malformed, unknown or revoked.
402insufficient_balanceBalance is under $0.01, the minimum to start a call.
429rate_limitedOver 60 requests/minute on this key. Retry-After says when.
400model_not_availableUnknown model, or one you have no key for.

Billing

  • At cost, 0% fee. You pay tokens × the published price per million, and nothing else. The forgent.cost_micro_usd field on every response is the exact amount debited, in micro-USD (1,000,000 = $1). That key is forgent, not gyrent: it is part of the response contract and keeps its original spelling so existing parsers keep working. It is not a leftover.
  • Paid from your USDC balance. Same balance as jobs. Deposit to top up; a call needs at least $0.01 to start.
  • Charged after the call.A completion’s price is not knowable until it exists, so nothing is held up front and you are never charged for more than you used.
  • BYOK is free. With your own provider key stored, calls to that provider run on it and are not debited at all — we still record the usage so your history stays complete.
  • Rate limit: 60 requests/minute per key. A 429 carries Retry-After.

Every debit appears in Activity as gateway.inference.