Skip to main content

From Your Server

linkFetch makes an access token from the refresh token, keeps it in memory, and replaces it when it expires. Safe to use from many servers at once, and cheap to make on every request. In the other tabs, one call makes the access token from the refresh token you saved, and it lasts an hour: see Refresh.

With An SDK

Point any OpenAI or Anthropic SDK at Dari, with an access token as the key:
An access token lasts an hour. For longer work, or a process outside your server such as a sandbox, mint a child token and use it as the key.

Apps Without A Server

A public client (a browser-only, desktop, or CLI app) has no secret, so its refresh token rotates: each refresh returns a new one, and the old one stops working. Save every reply before you use it.
Save what exchange returns the same way when the user connects. With the Node client, childToken, grant, and usage take the same two functions.

Endpoints

Model Names

Ask for a model the user’s plans can’t serve and you get 424 model_not_granted. Check GET /v1/models first.

Response Headers