Skip to main content
Connect Abstract lets your customers approve your app, choose its models, and set a monthly usage limit. Inference bills their Abstract account under its existing credit and Pass rules. Your app receives renewable access tokens. It never receives the customer’s API key.

Register your app

Sign in to Connected apps, then choose Register an app. Enter a name, an HTTPS homepage, and an HTTPS callback URL on the same origin. URLs cannot contain credentials, query strings, or fragments. The callback must match exactly on authorization and code exchange. Use a separate registration for each environment. Save the client ID. Registrations are public OAuth clients using S256 PKCE; there is no client secret. The app name is developer-supplied, and consent shows its domain. Registration is not verification or endorsement by Abstract.

Ask the customer to connect

For each attempt, generate a cryptographically random state and a PKCE code_verifier of 43–128 characters (A–Z, a–z, 0–9, -, ., _, ~). Save both against your customer’s browser session on your backend. Compute code_challenge as the unpadded base64url encoding of SHA-256 of the verifier. Send the browser to:
The customer signs into Abstract, selects allowed models, enters a monthly limit in USD, and approves. The browser returns to your callback with code, the original state, and iss=https://platform.abstract.inc. Cancellation returns error=access_denied instead of a code. Check both state and iss before proceeding. Never log the callback query.

Exchange the code

From your backend, POST URL-encoded fields to https://api.abstract.inc/v1/oauth/token:
The code expires after two minutes and can be exchanged once. A successful response is:
Store tokens as secrets on your backend, associated with the customer who began the flow. Do not put them in URLs, logs, analytics, or browser storage. The token endpoint is intended for backend calls and does not enable browser CORS. Use the access token in the Authorization: Bearer header on inference requests. It authorizes:
  • POST /v1/chat/completions and retrieval of this connection’s completions.
  • POST /v1/get_action, POST /v1/end_session, and GET /v1/ready for approved robot models.
  • POST /v1/sessions for direct sessions on approved models.
  • GET /v1/models, filtered to approved models in that catalog.
Tokens cannot manage keys, billing settings, compute nodes, datasets, fine-tuning, or private deployments. Access to models added later requires the customer to approve again. For robot calls, begin each session_id with the returned session_id_prefix, then append a unique episode identifier. This isolates your app’s episodes from other apps on the account. POST /v1/sessions generates a session ID with this prefix when one is omitted. Pass that ID on subsequent calls. This does not change the model’s observation or action contract.

Renew access

Access tokens expire after 15 minutes. Before expiry, POST these URL-encoded fields to the same token endpoint:
Save both replacement tokens atomically. Refresh invalidates the previous access and refresh tokens. Only one refresh may run at a time per connection. Refresh tokens expire after 30 days without renewal. Reusing an already consumed refresh token revokes the connection’s current credentials. If a refresh response is lost, reconnect; do not retry the old refresh token. The OAuth metadata is at https://platform.abstract.inc/.well-known/oauth-authorization-server.

Limits and disconnection

Customers can inspect usage, change the monthly limit, or disconnect in Connected apps. A limit includes settled usage and outstanding maximum-cost reservations, at model list rates, including usage covered by a Pass. It resets at the beginning of each calendar month in UTC. Reconnecting does not erase spending history. The account’s own payment and spending checks still apply. Nothing falls back to charging the app developer. Disconnecting stops new requests and token renewals. Requests already authorized can finish. A direct robot session’s already reserved block remains usable until its ticket expires (five minutes); obtaining another block requires a valid connected-app token and available budget. Lowering a cap does not cancel work already reserved. The normal inference errors for insufficient account credit and account spending limits also apply.