Credits - Python SDK

Credits method reference

The Python SDK and docs are currently in beta. Report issues on GitHub.

(credits)

Overview

Credit management endpoints

Available Operations

get_credits

Get total credits purchased and used for the authenticated user. Provisioning key required.

Example Usage

Parameters

ParameterTypeRequiredDescription
retriesOptional[utils.RetryConfig]Configuration to override the default retry behavior of the client.

Response

operations.GetCreditsResponse

Errors

Error TypeStatus CodeContent Type
errors.UnauthorizedResponseError401application/json
errors.ForbiddenResponseError403application/json
errors.InternalServerResponseError500application/json
errors.OpenRouterDefaultError4XX, 5XX*/*

create_coinbase_charge

Create a Coinbase charge for crypto payment

Example Usage

Parameters

ParameterTypeRequiredDescription
securityoperations.CreateCoinbaseChargeSecurity✔️N/A
amountfloat✔️N/A
senderstr✔️N/A
chain_idcomponents.ChainID✔️N/A
retriesOptional[utils.RetryConfig]Configuration to override the default retry behavior of the client.

Response

operations.CreateCoinbaseChargeResponse

Errors

Error TypeStatus CodeContent Type
errors.BadRequestResponseError400application/json
errors.UnauthorizedResponseError401application/json
errors.TooManyRequestsResponseError429application/json
errors.InternalServerResponseError500application/json
errors.OpenRouterDefaultError4XX, 5XX*/*