API keys
Get current API key
The key you call with: its spending limit, what is left of it, and what it has spent in total, today, this week and this month. Windows are in UTC. It costs nothing to call.
/ v1 / keyAuthorizations
AuthorizationstringheaderrequiredBearer authentication header of the form Bearer <token>, where <token> is your API key.
Response
The key.
dataobjectrequiredThe key.
Show child attributesHide child attributes
labelstringrequiredThe key, masked.
Example:
"sk-libremodel-...a3f9"limitnumber | nullrequiredIts spending limit, in dollars, per window.
nullwhen it has none.Example:
50limit_remainingnumber | nullrequiredWhat is left of the limit in the current window.
Example:
41.25limit_resetstring | nullrequiredWhen the limit starts over.
nullif it never does.Allowed values:
"daily""weekly""monthly"nullusagenumberrequiredSpent by this key, in total.
usage_dailynumberrequiredSpent today.
usage_weekly(since Monday) andusage_monthly(since the 1st) work the same way.is_free_tierbooleanrequiredtrueif the account has never loaded credits.
The key is missing, wrong, revoked or expired.
errorobjectrequiredThe error.
Show child attributesHide child attributes
messagestringrequiredWhat went wrong, for a person to read.
typestringrequiredThe error family, as in the OpenAI API.
Example:
"authentication_error"codestringrequiredThe exact cause. Branch on this one. All codes: Limits and errors.
Example:
"invalid_api_key"paramnullrequiredAlways
null.
Temporarily unavailable. Retry after a short wait.
errorobjectrequiredThe error.
Show child attributesHide child attributes
messagestringrequiredWhat went wrong, for a person to read.
typestringrequiredThe error family, as in the OpenAI API.
Example:
"authentication_error"codestringrequiredThe exact cause. Branch on this one. All codes: Limits and errors.
Example:
"invalid_api_key"paramnullrequiredAlways
null.