Error
A valid request URL is required to generate request examples{
"object": "<string>",
"model": "<string>",
"input_tokens": 123,
"input_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_read_tokens": 123,
"cached_write_tokens": 123
},
"tokens": [
123
],
"token_strings": [
"<string>"
],
"output_tokens": 123,
"total_tokens": 123,
"extra_fields": {
"request_type": "<string>",
"model_requested": "<string>",
"model_deployment": "<string>",
"latency": 123,
"chunk_index": 123,
"raw_request": {},
"raw_response": {},
"cache_debug": {
"cache_hit": true,
"cache_id": "<string>",
"hit_type": "<string>",
"requested_provider": "<string>",
"requested_model": "<string>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"threshold": 123,
"similarity": 123
}
}
}PydanticAI Integration
Count input tokens (PydanticAI - OpenAI format)
Counts the number of tokens in a Responses API request via PydanticAI.
POST
/
pydanticai
/
v1
/
responses
/
input_tokens
Error
A valid request URL is required to generate request examples{
"object": "<string>",
"model": "<string>",
"input_tokens": 123,
"input_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_read_tokens": 123,
"cached_write_tokens": 123
},
"tokens": [
123
],
"token_strings": [
"<string>"
],
"output_tokens": 123,
"total_tokens": 123,
"extra_fields": {
"request_type": "<string>",
"model_requested": "<string>",
"model_deployment": "<string>",
"latency": 123,
"chunk_index": 123,
"raw_request": {},
"raw_response": {},
"cache_debug": {
"cache_hit": true,
"cache_id": "<string>",
"hit_type": "<string>",
"requested_provider": "<string>",
"requested_model": "<string>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"threshold": 123,
"similarity": 123
}
}
}Authorizations
BearerAuthBasicAuthVirtualKeyAuthApiKeyAuth
Bearer token authentication. Use your provider API key or Bifrost authentication token.
Virtual keys (prefixed with sk-bf-) can also be passed here.
Body
application/json
Model identifier
Example:
"gpt-4"
Input - can be a string or array of messages
System instructions for the model
Show child attributes
Show child attributes
Required range:
0 <= x <= 2Show child attributes
Show child attributes
Available options:
none, auto, required Show child attributes
Show child attributes
Available options:
auto, disabled Was this page helpful?
⌘I

