Skip to main content
POST
/
pricing
/
calculate
Calculate pricing
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({provider: '<string>', model: '<string>', endpoint: '<string>', usage: {}})
};

fetch('https://api.phaseo.app/v1/pricing/calculate', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "ok": true,
  "pricing": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt

Use this file to discover all available pages before exploring further.

Calculates pricing for a supplied usage payload against the active gateway pricing rules. Provide:
  • provider: provider ID, for example openai
  • model: routed model ID
  • endpoint: endpoint family, for example responses or chat.completions
  • usage: the usage object to price, such as token counts or other meter inputs
Use this route when you already know the target provider/model/endpoint and want a bill estimate for a specific usage payload, as opposed to GET /pricing/models, which lists the current public catalogue pricing surfaces.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
provider
string
required
model
string
required
endpoint
string
required
usage
object
required

Response

Pricing calculation result

ok
boolean
pricing
object
Last modified on May 6, 2026