Skip to main content
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>",
    "provider": "openai",
    "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

Authorization
string
header
required

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
string
required

Model identifier

Example:

"gpt-4"

input
required

Input - can be a string or array of messages

stream
boolean
instructions
string

System instructions for the model

max_output_tokens
integer
metadata
object
parallel_tool_calls
boolean
previous_response_id
string
reasoning
object
store
boolean
temperature
number
Required range: 0 <= x <= 2
text
object
tool_choice
Available options:
none,
auto,
required
tools
object[]
top_p
number
truncation
enum<string>
Available options:
auto,
disabled
user
string
fallbacks
string[]

Response

Successful response

object
string
model
string
input_tokens
integer
input_tokens_details
object
tokens
integer[]
token_strings
string[]
output_tokens
integer
total_tokens
integer
extra_fields
object

Additional fields included in responses