[metadata]
apple-mobile-web-app-title: OpenRouter | Documentation
application-name: OpenRouter | Documentation
description: Get total credits purchased and used for the authenticated user. Management key required.
generator: Mintlify
msapplication-TileColor: #7624F4
msapplication-config: /docs/_mintlify/favicons/openrouter-d02e98a0/EmhfYwFO2tvnkuV-/_generated/favicon/browserconfig.xml
og:description: Get total credits purchased and used for the authenticated user. Management key required.
og:image: https://openrouter-d02e98a0.mintlify.app/_next/image?url=%2F_mintlify%2Fapi%2Fog%3Fdivision%3DCredits%26appearance%3Ddark%26title%3DGet%2Bremaining%2Bcredits%26description%3DGet%2Btotal%2Bcredits%2Bpurchased%2Band%2Bused%2Bfor%2Bthe%2Bauthenticated%2Buser.%2B%255BManagement%2Bkey%255D%2528%252Fdocs%252Fguides%252Foverview%252Fauth%252Fmanagement-api-keys%2529%2Brequired.%26logoLight%3Dhttps%253A%252F%252Fmintcdn.com%252Fopenrouter-d02e98a0%252FksNSeB_K7gD-BUDh%252Fassets%252Flogo-v2-light.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253DksNSeB_K7gD-BUDh%2526q%253D85%2526s%253D690e45873843519efe02bcbe45795dac%26logoDark%3Dhttps%253A%252F%252Fmintcdn.com%252Fopenrouter-d02e98a0%252FksNSeB_K7gD-BUDh%252Fassets%252Flogo-v2-dark.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253DksNSeB_K7gD-BUDh%2526q%253D85%2526s%253D8ba2f49b11cd9839c37dd03c62537ebd%26primaryColor%3D%25237624F4%26lightColor%3D%25237624F4%26backgroundLight%3D%2523FCFCFE%26backgroundDark%3D%252303080A&w=1200&q=100
og:image:height: 630
og:image:width: 1200
og:site_name: OpenRouter | Documentation
og:title: Get remaining credits - OpenRouter | Documentation
og:type: website
og:url: https://openrouter.ai/docs/api/api-reference/credits/get-remaining-credits
twitter:card: summary_large_image
twitter:description: Get total credits purchased and used for the authenticated user. Management key required.
twitter:image: https://openrouter-d02e98a0.mintlify.app/_next/image?url=%2F_mintlify%2Fapi%2Fog%3Fdivision%3DCredits%26appearance%3Ddark%26title%3DGet%2Bremaining%2Bcredits%26description%3DGet%2Btotal%2Bcredits%2Bpurchased%2Band%2Bused%2Bfor%2Bthe%2Bauthenticated%2Buser.%2B%255BManagement%2Bkey%255D%2528%252Fdocs%252Fguides%252Foverview%252Fauth%252Fmanagement-api-keys%2529%2Brequired.%26logoLight%3Dhttps%253A%252F%252Fmintcdn.com%252Fopenrouter-d02e98a0%252FksNSeB_K7gD-BUDh%252Fassets%252Flogo-v2-light.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253DksNSeB_K7gD-BUDh%2526q%253D85%2526s%253D690e45873843519efe02bcbe45795dac%26logoDark%3Dhttps%253A%252F%252Fmintcdn.com%252Fopenrouter-d02e98a0%252FksNSeB_K7gD-BUDh%252Fassets%252Flogo-v2-dark.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253DksNSeB_K7gD-BUDh%2526q%253D85%2526s%253D8ba2f49b11cd9839c37dd03c62537ebd%26primaryColor%3D%25237624F4%26lightColor%3D%25237624F4%26backgroundLight%3D%2523FCFCFE%26backgroundDark%3D%252303080A&w=1200&q=100
twitter:image:height: 630
twitter:image:width: 1200
twitter:title: Get remaining credits - OpenRouter | Documentation
viewport: width=device-width, initial-scale=1, viewport-fit=cover

[canonical-links]
https://openrouter.ai/docs/api/api-reference/credits/get-remaining-credits

[document-links]
/docs/llms.txt: /docs/llms.txt
API Changelog: /docs/changelog
API Reference: /docs/api_reference/overview
API Versioning: /docs/api_reference/versioning
Agent SDK: /docs/agent-sdk/overview
Apps: https://openrouter.ai/apps
Authentication: /docs/api_reference/authentication
Benchmarks: https://openrouter.ai/benchmarks
Chat: https://openrouter.ai/chat
Client SDKs: /docs/client-sdks/overview
Cookbook: /docs/cookbook/get-started/quickstart
Deprecated Coinbase Commerce charge endpoint: /docs/api/api-reference/credits/deprecated-coinbase-commerce-charge-endpoint
Docs: /docs/quickstart
Docs: https://openrouter.ai/docs
Embeddings: /docs/api_reference/embeddings
Errors and Debugging: /docs/api_reference/errors-and-debugging
GET Get remaining credits: /docs/api/api-reference/credits/get-remaining-credits
Limits: /docs/api_reference/limits
Management key: /docs/guides/overview/auth/management-api-keys
Models: https://openrouter.ai/models
OpenRouter | Documentation home page: https://openrouter.ai
Overview: /docs/api_reference/overview
POST Deprecated Coinbase Commerce charge endpoint deprecated: /docs/api/api-reference/credits/deprecated-coinbase-commerce-charge-endpoint
Parameters: /docs/api_reference/parameters
Rankings: https://openrouter.ai/rankings
Streaming: /docs/api_reference/streaming
Task classification market share: /docs/api/api-reference/classifications/task-classification-market-share

[content]
Get remaining credits - OpenRouter | Documentation
Documentation Index
Fetch the complete documentation index at:
/docs/llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
OpenRouter | Documentation
home page
Search...
⌘
K
Ask Assistant
Models
Benchmarks
Chat
Rankings
Apps
Docs
Search...
Navigation
Credits
Get remaining credits
Docs
API Reference
Client SDKs
Agent SDK
Cookbook
API Guides
Overview
Streaming
Embeddings
Limits
Authentication
Parameters
Errors and Debugging
Responses API
Versioning
API Versioning
API Changelog
API Reference
Analytics
TTS
STT
OAuth
Benchmarks
BYOK
Chat
Classifications
Credits
GET
Get remaining credits
POST
Deprecated Coinbase Commerce charge endpoint
deprecated
Datasets
Embeddings
Endpoints
Generations
Guardrails
Images
API Keys
Anthropic Messages
Models
Observability
Organization
Presets
Providers
Rerank
Responses
SCIM
Video Generation
Workspaces
Get remaining credits
cURL
curl --request GET \ --url https://openrouter.ai/api/v1/credits \ --header 'Authorization: Bearer <token>'
import requests url = "https://openrouter.ai/api/v1/credits" headers = {"Authorization": "Bearer <token>"} response = requests.get(url, headers=headers) print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}}; fetch('https://openrouter.ai/api/v1/credits', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://openrouter.ai/api/v1/credits", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer <token>" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
package main import ( "fmt" "net/http" "io" ) func main() { url := "https://openrouter.ai/api/v1/credits" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer <token>") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) }
HttpResponse<String> response = Unirest.get("https://openrouter.ai/api/v1/credits") .header("Authorization", "Bearer <token>") .asString();
require 'uri' require 'net/http' url = URI("https://openrouter.ai/api/v1/credits") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer <token>' response = http.request(request) puts response.read_body
200
401
403
500
{ "data": { "total_credits": 100.5, "total_usage": 25.75 } }
{ "error": { "code": 401, "message": "Missing Authentication header" } }
{ "error": { "code": 403, "message": "Only management keys can perform this operation" } }
{ "error": { "code": 500, "message": "Internal Server Error" } }
Credits
Get remaining credits
Copy page
Copy page
Get total credits purchased and used for the authenticated user.
Management key
required.
Copy page
Copy page
GET
/
credits
Try it
Get remaining credits
cURL
curl --request GET \ --url https://openrouter.ai/api/v1/credits \ --header 'Authorization: Bearer <token>'
import requests url = "https://openrouter.ai/api/v1/credits" headers = {"Authorization": "Bearer <token>"} response = requests.get(url, headers=headers) print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}}; fetch('https://openrouter.ai/api/v1/credits', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://openrouter.ai/api/v1/credits", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer <token>" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
package main import ( "fmt" "net/http" "io" ) func main() { url := "https://openrouter.ai/api/v1/credits" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer <token>") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) }
HttpResponse<String> response = Unirest.get("https://openrouter.ai/api/v1/credits") .header("Authorization", "Bearer <token>") .asString();
require 'uri' require 'net/http' url = URI("https://openrouter.ai/api/v1/credits") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer <token>' response = http.request(request) puts response.read_body
200
401
403
500
{ "data": { "total_credits": 100.5, "total_usage": 25.75 } }
{ "error": { "code": 401, "message": "Missing Authentication header" } }
{ "error": { "code": 403, "message": "Only management keys can perform this operation" } }
{ "error": { "code": 500, "message": "Internal Server Error" } }
Authorizations
​
Authorization
string
header
required
API key as bearer token in Authorization header
Response
200
application/json
Returns the total credits purchased and used
Total credits purchased and used
​
data
object
required
Show
child attributes
Example
:
{ "total_credits": 100.5, "total_usage": 25.75 }
Task classification market share
Deprecated Coinbase Commerce charge endpoint
⌘
I
Assistant
Responses are generated using AI and may contain mistakes.
