Quickstart

Integrate in minutes: point your OpenAI-compatible SDK at our baseURL. This guide covers access through the TokenRecarga API (mt_live_ key); if your access was delivered another way, the instructions come with your credentials.

No account yet? Request a proposal

Authentication

Every call carries your key in the Authorization header. Keys start with mt_live_ and are shown only once at creation.

Authorization: Bearer mt_live_...

Endpoint

POST https://www.tokenrecarga.com.br/api/v1/chat/completions
GET  https://www.tokenrecarga.com.br/api/v1/models

Examples

curl https://www.tokenrecarga.com.br/api/v1/chat/completions \
  -H "Authorization: Bearer mt_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{"role": "user", "content": "Olá!"}]
  }'

Streaming

Pass stream: true and receive standard OpenAI SSE. Billing stays correct even if the connection drops mid-response.

Response headers

Every response reports the data destination region and the metering origin.

  • x-mt-data-region

    Country this call's data was sent to (LGPD transparency)

  • x-mt-vendor · x-mt-supplier

    Model vendor and the supplier this call was routed through

  • x-mt-cost-brl · x-mt-balance-brl

    Cost of this call and remaining balance, in BRL (non-stream responses)

  • x-mt-request-id

    This call's number (req_…), on every response including streaming and errors. Use it to find the call under Usage in the dashboard and when contacting support. For idempotency, send your own X-Request-Id: the same key with the same X-Request-Id is billed only once.

Errors

Errors follow the OpenAI format: an HTTP status plus an error object with message, type and code. Handle each case by code — there are two kinds of 429, and only one of them should be retried.

  • 401 · invalid_api_key

    Invalid, revoked or disabled key.

  • 402 · insufficient_quota

    Insufficient balance for this call. Top up to continue.

  • 403 · organization_inactive

    Your company account is not active — being set up or suspended. The notice in the dashboard says why. Do not retry the call.

  • 403 · wallet_inactive

    The account wallet is suspended. Topping up does not help: contact us.

  • 403 · model_not_on_plan

    The model exists in the catalogue but is not included in your account's plan. Request access through /proposta.

  • 400 · model_not_found

    The model name is incorrect. List valid names with GET /v1/models.

  • 403 · model_not_allowed

    This API key is restricted to other models. Change its allowed models in the dashboard under API keys, or use another key.

  • 429 · key_spend_limit_exceeded

    The key reached its own daily or monthly spending limit — the message says which. It is not a balance problem, so a top-up will not help. Change the limit in the dashboard under API keys → Edit, or wait for the day or month to roll over (00:00 UTC). The response carries x-should-retry: false and no Retry-After: do not retry the call.

  • 429 · rate_limit_exceeded

    The key's requests-per-minute limit was exceeded. Retry after the time given in the Retry-After header.

  • 503 · upstream_unavailable

    The model could not respond right now. Try again shortly.

  • 503 · no_supply_route

    This model is not enabled for your account right now — usually because the manufacturer is not yet in your data processing agreement (DPA). The message says why; contact us to add it.

Download OpenAPI spec