API Key & Balance
Endpoints to inspect API key metadata, check spending limits, and query current account credit balance. These endpoints are designed to be 100% drop-in compatible with OpenRouter, DeepSeek, CC Switch, Cline, Roo Code, and OpenWebUI.
1. Check API Key & Quota (GET /v1/key)
Inspects the status, friendly label, usage, and remaining balance associated with the caller's API key. This follows the official OpenRouter Key API specification.
Endpoint
GET https://api.dos.ai/v1/key
GET https://api.dos.ai/v1/auth/keyRoot Alias: If your client configures the base URL as
https://api.dos.ai(without/v1), requests toGET /keyandGET /auth/keyare also supported.
Authentication
Authorization: Bearer dos_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxResponse
Success (200 OK)
{
"data": {
"label": "My Project Key",
"usage": 14.25,
"limit": null,
"is_free_tier": false,
"rate_limit": {
"requests": 500,
"interval": "10s"
},
"limit_remaining": 35.75
}
}Response Fields
data.label
string
The friendly name or label given to this API key in the dashboard.
data.usage
number
Total amount spent in USD by this account.
data.limit
number | null
Hard spending limit set for this key/account in USD. Returns null for pay-as-you-go accounts without an explicit spending cap.
data.limit_remaining
number
Current available credit balance in USD that can be used for requests.
data.is_free_tier
boolean
Set to true if the account is on an initial free tier or if balance has been exhausted.
data.rate_limit
object
The rate limit enforced for this key.
data.rate_limit.requests
integer
Number of allowed requests per interval window.
data.rate_limit.interval
string
The duration of the rate limit window (e.g., "10s").
2. Query User Balance (GET /v1/user/balance)
Queries account balance and credit status. Designed for full compatibility with CC Switch, DeepSeek User Balance API, and NewAPI / OneAPI.
Endpoint
Root Alias: Requests to
GET /user/balance,POST /user/balance, andGET /creditsdirectly onhttps://api.dos.aiare also supported.
Authentication
Response
Active Account with Balance (200 OK)
Exhausted Balance (200 OK)
When an account has no remaining balance (balance <= 0):
Examples
cURL
Python
JavaScript / Node.js
Last updated