Skip to main content

Returns

Returns a Model object for the given parameters, or None if an error occurs.

Example

Parameters

string
required
Name of the model. Must be unique within your organization.
float
Cost in dollars per input token.
float
Cost in dollars per output token.
float
Cost in dollars per cached input token. Some providers offer reduced rates for cached requests.
float
Cost in dollars per input token when creating a cache entry.
float
Cost in dollars per input token for contexts larger than 128k tokens, if applicable.
float
Cost in dollars per output token for contexts larger than 128k tokens, if applicable.
string
Provider of the tokenizer used by the model. Examples: "OpenAI" (uses tiktoken), "Anthropic" (uses anthropic-tokenizer).
string
The provider or source of the pricing model. This can be a URL to the model’s pricing page or documentation (e.g., https://openai.com/api/pricing/).