Error
A valid request URL is required to generate request examples{
"input_tokens": 123
}LangChain Integration
Count tokens (LangChain - Anthropic format)
Counts tokens using Anthropic-compatible format via LangChain.
POST
/
langchain
/
anthropic
/
v1
/
messages
/
count_tokens
Error
A valid request URL is required to generate request examples{
"input_tokens": 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 (e.g., claude-3-opus-20240229)
Example:
"claude-3-opus-20240229"
Maximum tokens to generate
List of messages in the conversation
Show child attributes
Show child attributes
System prompt
Automatic caching directives for the whole request
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Whether to stream the response
Required range:
0 <= x <= 1Show child attributes
Show child attributes
Show child attributes
Show child attributes
MCP servers configuration (requires beta header)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Structured output format (requires beta header)
Response
Successful response
Number of input tokens
Was this page helpful?
⌘I

