Skip to content

Get started

Authentication and URLs

Base URLs

The same key works in both formats. Use the base URL your SDK or tool expects:

FormatBase URLEndpoints
OpenAIhttps://api.offmem.app/v1POST /chat/completions
GET /models
Anthropichttps://api.offmem.appPOST /v1/messages
POST /v1/messages/count_tokens

The Anthropic SDKs append /v1/messages to the base URL themselves, so the base URL has no /v1. The address https://offmem.app/v1 also answers, as an alias of https://api.offmem.app/v1.

API key

Keys are created in Console › API keys and have the format om_ followed by 40 letters and digits. We store only a hash of the key, so it is shown once, when created. Send it in one of these headers:

  • Authorization: Bearer om_... (OpenAI SDKs and most tools)
  • x-api-key: om_... (Anthropic SDKs)
curl https://api.offmem.app/v1/chat/completions \
  -H "Authorization: Bearer $OFFMEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "offmem-glm-5.3-flash-abliterated", "messages": [{"role": "user", "content": "ok"}]}'

Key options

OptionEffect
NameIdentifies the key in the console.
Allowed modelsRequests to other models return 403 modelo_nao_permitido. All checked means no restriction, including future models.
Daily cap (R$)Spend limit per day. Reached: 402 teto_chave.
Monthly cap (R$)Spend limit per month. Reached: 402 teto_chave.
Expiration7, 30, 90 or 365 days, or none. Expired: 401 chave_expirada.

Day and month follow Brasília time (America/Sao_Paulo). A revoked key stops working on the next request and returns 401 chave_revogada.

Server-side only

The API does not send CORS headers: browsers block calls made from another website. Call it from your server, script or local tool, and never put the key in front-end code.

Account requirements

  • Terms of use accepted in the console. Otherwise: 403 termos.
  • Balance for the request. Otherwise: 402 sem_saldo. See Billing.

Request ID

Each billed request returns its ID in the x-offmem-request-id header (OpenAI format) or request-id (Anthropic format). The same ID appears in the console history.

Request content is not stored. We keep model, tokens, cost, status and latency, plus the access log required by Brazilian law. Details in the privacy policy.