Get account balance

GET /v1/user/balance

Returns the current DZD balance for the authenticated user.

Authentication

Bearer API key required.

Responses

HTTP 200

Balance retrieved successfully.

application/json

BalanceResponse

BalanceResponse

{
  "balance_dzd": 500
}

HTTP 401

Missing, empty, or revoked API key. This response covers three distinct codes depending on the authentication path: - missing_api_key: Authorization header absent or Bearer token is empty. On GET /v1/models, GET /v1/models/{model}, GET /v1/me and GET /v1/me/avatar, which also accept the x-api-key header, the message is "Provide your API key as: Authorization: Bearer sk-devup-..., or in the x-api-key header." - invalid_api_key: Key not found, deactivated, or not valid. - token_revoked: The scoped JWT credential has been explicitly revoked.

application/json

ErrorResponse

ErrorResponse

Authorization header absent or empty Bearer token
{
  "error": {
    "message": "Provide your API key as: Authorization: Bearer sk-devup-...",
    "type": "devup_error",
    "code": "missing_api_key"
  }
}
Key not found, deactivated, or not valid
{
  "error": {
    "message": "The API key provided is invalid or has been deactivated.",
    "type": "devup_error",
    "code": "invalid_api_key"
  }
}
Scoped JWT credential has been explicitly revoked (scoped-token auth only)
{
  "error": {
    "message": "This scoped token has been revoked.",
    "type": "devup_error",
    "code": "token_revoked"
  }
}

HTTP 403

Account suspended or scoped credential does not permit the requested model. - account_suspended: The DEVUP account is suspended; all requests are blocked. - model_not_allowed: The scoped credential does not grant access to the requested model. This code is never returned for unrestricted master API keys. - scoped_token_not_allowed: On GET /v1/me and GET /v1/me/avatar, which accept account API keys (sk-devup-...) only, a scoped token was sent.

application/json

ErrorResponse

ErrorResponse

DEVUP account is suspended
{
  "error": {
    "message": "Account suspended. Contact support.",
    "type": "devup_error",
    "code": "account_suspended"
  }
}
Scoped credential does not permit the requested model (scoped-token auth only)
{
  "error": {
    "message": "This scoped token does not grant access to the requested model.",
    "type": "devup_error",
    "code": "model_not_allowed"
  }
}

HTTP 500

An unexpected internal error occurred.

application/json

ErrorResponse

ErrorResponse

{
  "error": {
    "message": "Internal server error.",
    "type": "devup_error",
    "code": "internal_error"
  }
}