A valid request URL is required to generate request examples{
"model": "<string>",
"pages": [
{
"index": 1,
"markdown": "<string>",
"images": [
{
"id": "<string>",
"top_left_x": 123,
"top_left_y": 123,
"bottom_right_x": 123,
"bottom_right_y": 123,
"image_base64": "<string>"
}
],
"dimensions": {
"dpi": 123,
"height": 123,
"width": 123
},
"tables": [
{}
],
"header": "<string>",
"footer": "<string>",
"confidence_scores": {
"average_page_confidence_score": 123,
"minimum_page_confidence_score": 123,
"word_confidence_scores": [
123
]
}
}
],
"usage_info": {
"pages_processed": 123,
"doc_size_bytes": 123
},
"document_annotation": "<string>",
"extra_fields": {
"request_type": "<string>",
"pricing_request_type": "<string>",
"routing_info": {
"provider": "anthropic",
"model": "<string>",
"key": "<string>",
"resolved_key_alias": {
"model_id": "<string>",
"model_name": "<string>",
"model_family": "<string>"
},
"is_fallback": true,
"primary_provider": "anthropic",
"primary_model": "<string>",
"requested_provider": "anthropic",
"requested_model": "<string>",
"server_side_fallback_model": "<string>"
},
"provider": "anthropic",
"original_model_requested": "<string>",
"resolved_model_used": "<string>",
"latency": 123,
"upstream_latency": 123,
"chunk_index": 123,
"raw_request": "<unknown>",
"raw_response": "<unknown>",
"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,
"cache_hit_latency": 123
},
"routing_metadata": {
"calls": [
{
"request_type": "<string>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"output_tokens": 123,
"count_toward_budgets": true
}
]
},
"guardrail_debug": {
"judge_calls": [
{
"phase": "<string>",
"rule_id": 123,
"rule_name": "<string>",
"guardrail_name": "<string>",
"guardrail_provider": "<string>",
"action": "<string>",
"reason": "<string>",
"judge_provider": "<string>",
"judge_model": "<string>",
"judge_request_type": "<string>",
"prompt_tokens": 123,
"prompt_tokens_details": {},
"completion_tokens": 123,
"completion_tokens_details": {},
"total_tokens": 123
}
],
"detections": [
{
"phase": "<string>",
"rule_id": 123,
"rule_name": "<string>",
"guardrail_name": "<string>",
"guardrail_provider": "<string>",
"reason": "<string>",
"assessments": [
"<string>"
],
"action": "detect",
"enforced": true
}
]
},
"parse_errors": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>",
"line": 123
}
],
"converted_request_type": "<string>",
"dropped_compat_plugin_params": [
"<string>"
],
"dropped_unsupported_tools": [
"<string>"
],
"provider_response_headers": {},
"passthrough_path": "<string>"
}
}{
"event_id": "<string>",
"type": "<string>",
"is_bifrost_error": true,
"status_code": 123,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"event_id": "<string>"
},
"extra_fields": {
"routing_info": {
"provider": "anthropic",
"model": "<string>",
"key": "<string>",
"resolved_key_alias": {
"model_id": "<string>",
"model_name": "<string>",
"model_family": "<string>"
},
"is_fallback": true,
"primary_provider": "anthropic",
"primary_model": "<string>",
"requested_provider": "anthropic",
"requested_model": "<string>",
"server_side_fallback_model": "<string>"
},
"provider": "anthropic",
"original_model_requested": "<string>",
"resolved_model_used": "<string>",
"request_type": "<string>",
"mcp_request_type": "<string>",
"a2a_request_type": "<string>",
"a2a_agent_name": "<string>",
"error_type": "<string>",
"retry_after_ms": 150500,
"raw_request": "<unknown>",
"raw_response": "<unknown>",
"converted_request_type": "<string>",
"dropped_compat_plugin_params": [
"<string>"
],
"latency": 123,
"key_statuses": [
{
"key_id": "<string>",
"status": "success",
"provider": "anthropic",
"error": "<unknown>"
}
],
"mcp_auth_required": {
"kind": "<string>",
"mcp_client_id": "<string>",
"mcp_client_name": "<string>",
"message": "<string>",
"authorize_url": "<string>",
"session_id": "<string>"
},
"billed_usage": {
"prompt_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_read_tokens": 123,
"cached_write_tokens": 123
},
"completion_tokens": 123,
"completion_tokens_details": {
"text_tokens": 123,
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123,
"image_tokens": 123,
"rejected_prediction_tokens": 123
},
"total_tokens": 123,
"tool_usage": {
"web_search": {
"num_requests": 123
}
},
"cost": {
"input_tokens_cost": 123,
"output_tokens_cost": 123,
"reasoning_tokens_cost": 123,
"citation_tokens_cost": 123,
"search_queries_cost": 123,
"request_cost": 123,
"total_cost": 123
}
}
}
}{
"event_id": "<string>",
"type": "<string>",
"is_bifrost_error": true,
"status_code": 123,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"event_id": "<string>"
},
"extra_fields": {
"routing_info": {
"provider": "anthropic",
"model": "<string>",
"key": "<string>",
"resolved_key_alias": {
"model_id": "<string>",
"model_name": "<string>",
"model_family": "<string>"
},
"is_fallback": true,
"primary_provider": "anthropic",
"primary_model": "<string>",
"requested_provider": "anthropic",
"requested_model": "<string>",
"server_side_fallback_model": "<string>"
},
"provider": "anthropic",
"original_model_requested": "<string>",
"resolved_model_used": "<string>",
"request_type": "<string>",
"mcp_request_type": "<string>",
"a2a_request_type": "<string>",
"a2a_agent_name": "<string>",
"error_type": "<string>",
"retry_after_ms": 150500,
"raw_request": "<unknown>",
"raw_response": "<unknown>",
"converted_request_type": "<string>",
"dropped_compat_plugin_params": [
"<string>"
],
"latency": 123,
"key_statuses": [
{
"key_id": "<string>",
"status": "success",
"provider": "anthropic",
"error": "<unknown>"
}
],
"mcp_auth_required": {
"kind": "<string>",
"mcp_client_id": "<string>",
"mcp_client_name": "<string>",
"message": "<string>",
"authorize_url": "<string>",
"session_id": "<string>"
},
"billed_usage": {
"prompt_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_read_tokens": 123,
"cached_write_tokens": 123
},
"completion_tokens": 123,
"completion_tokens_details": {
"text_tokens": 123,
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123,
"image_tokens": 123,
"rejected_prediction_tokens": 123
},
"total_tokens": 123,
"tool_usage": {
"web_search": {
"num_requests": 123
}
},
"cost": {
"input_tokens_cost": 123,
"output_tokens_cost": 123,
"reasoning_tokens_cost": 123,
"citation_tokens_cost": 123,
"search_queries_cost": 123,
"request_cost": 123,
"total_cost": 123
}
}
}
}Perform OCR
Extracts text and content from documents or images using optical character recognition. Supports PDF URLs, base64-encoded documents, and image URLs.
A valid request URL is required to generate request examples{
"model": "<string>",
"pages": [
{
"index": 1,
"markdown": "<string>",
"images": [
{
"id": "<string>",
"top_left_x": 123,
"top_left_y": 123,
"bottom_right_x": 123,
"bottom_right_y": 123,
"image_base64": "<string>"
}
],
"dimensions": {
"dpi": 123,
"height": 123,
"width": 123
},
"tables": [
{}
],
"header": "<string>",
"footer": "<string>",
"confidence_scores": {
"average_page_confidence_score": 123,
"minimum_page_confidence_score": 123,
"word_confidence_scores": [
123
]
}
}
],
"usage_info": {
"pages_processed": 123,
"doc_size_bytes": 123
},
"document_annotation": "<string>",
"extra_fields": {
"request_type": "<string>",
"pricing_request_type": "<string>",
"routing_info": {
"provider": "anthropic",
"model": "<string>",
"key": "<string>",
"resolved_key_alias": {
"model_id": "<string>",
"model_name": "<string>",
"model_family": "<string>"
},
"is_fallback": true,
"primary_provider": "anthropic",
"primary_model": "<string>",
"requested_provider": "anthropic",
"requested_model": "<string>",
"server_side_fallback_model": "<string>"
},
"provider": "anthropic",
"original_model_requested": "<string>",
"resolved_model_used": "<string>",
"latency": 123,
"upstream_latency": 123,
"chunk_index": 123,
"raw_request": "<unknown>",
"raw_response": "<unknown>",
"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,
"cache_hit_latency": 123
},
"routing_metadata": {
"calls": [
{
"request_type": "<string>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"output_tokens": 123,
"count_toward_budgets": true
}
]
},
"guardrail_debug": {
"judge_calls": [
{
"phase": "<string>",
"rule_id": 123,
"rule_name": "<string>",
"guardrail_name": "<string>",
"guardrail_provider": "<string>",
"action": "<string>",
"reason": "<string>",
"judge_provider": "<string>",
"judge_model": "<string>",
"judge_request_type": "<string>",
"prompt_tokens": 123,
"prompt_tokens_details": {},
"completion_tokens": 123,
"completion_tokens_details": {},
"total_tokens": 123
}
],
"detections": [
{
"phase": "<string>",
"rule_id": 123,
"rule_name": "<string>",
"guardrail_name": "<string>",
"guardrail_provider": "<string>",
"reason": "<string>",
"assessments": [
"<string>"
],
"action": "detect",
"enforced": true
}
]
},
"parse_errors": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>",
"line": 123
}
],
"converted_request_type": "<string>",
"dropped_compat_plugin_params": [
"<string>"
],
"dropped_unsupported_tools": [
"<string>"
],
"provider_response_headers": {},
"passthrough_path": "<string>"
}
}{
"event_id": "<string>",
"type": "<string>",
"is_bifrost_error": true,
"status_code": 123,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"event_id": "<string>"
},
"extra_fields": {
"routing_info": {
"provider": "anthropic",
"model": "<string>",
"key": "<string>",
"resolved_key_alias": {
"model_id": "<string>",
"model_name": "<string>",
"model_family": "<string>"
},
"is_fallback": true,
"primary_provider": "anthropic",
"primary_model": "<string>",
"requested_provider": "anthropic",
"requested_model": "<string>",
"server_side_fallback_model": "<string>"
},
"provider": "anthropic",
"original_model_requested": "<string>",
"resolved_model_used": "<string>",
"request_type": "<string>",
"mcp_request_type": "<string>",
"a2a_request_type": "<string>",
"a2a_agent_name": "<string>",
"error_type": "<string>",
"retry_after_ms": 150500,
"raw_request": "<unknown>",
"raw_response": "<unknown>",
"converted_request_type": "<string>",
"dropped_compat_plugin_params": [
"<string>"
],
"latency": 123,
"key_statuses": [
{
"key_id": "<string>",
"status": "success",
"provider": "anthropic",
"error": "<unknown>"
}
],
"mcp_auth_required": {
"kind": "<string>",
"mcp_client_id": "<string>",
"mcp_client_name": "<string>",
"message": "<string>",
"authorize_url": "<string>",
"session_id": "<string>"
},
"billed_usage": {
"prompt_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_read_tokens": 123,
"cached_write_tokens": 123
},
"completion_tokens": 123,
"completion_tokens_details": {
"text_tokens": 123,
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123,
"image_tokens": 123,
"rejected_prediction_tokens": 123
},
"total_tokens": 123,
"tool_usage": {
"web_search": {
"num_requests": 123
}
},
"cost": {
"input_tokens_cost": 123,
"output_tokens_cost": 123,
"reasoning_tokens_cost": 123,
"citation_tokens_cost": 123,
"search_queries_cost": 123,
"request_cost": 123,
"total_cost": 123
}
}
}
}{
"event_id": "<string>",
"type": "<string>",
"is_bifrost_error": true,
"status_code": 123,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"event_id": "<string>"
},
"extra_fields": {
"routing_info": {
"provider": "anthropic",
"model": "<string>",
"key": "<string>",
"resolved_key_alias": {
"model_id": "<string>",
"model_name": "<string>",
"model_family": "<string>"
},
"is_fallback": true,
"primary_provider": "anthropic",
"primary_model": "<string>",
"requested_provider": "anthropic",
"requested_model": "<string>",
"server_side_fallback_model": "<string>"
},
"provider": "anthropic",
"original_model_requested": "<string>",
"resolved_model_used": "<string>",
"request_type": "<string>",
"mcp_request_type": "<string>",
"a2a_request_type": "<string>",
"a2a_agent_name": "<string>",
"error_type": "<string>",
"retry_after_ms": 150500,
"raw_request": "<unknown>",
"raw_response": "<unknown>",
"converted_request_type": "<string>",
"dropped_compat_plugin_params": [
"<string>"
],
"latency": 123,
"key_statuses": [
{
"key_id": "<string>",
"status": "success",
"provider": "anthropic",
"error": "<unknown>"
}
],
"mcp_auth_required": {
"kind": "<string>",
"mcp_client_id": "<string>",
"mcp_client_name": "<string>",
"message": "<string>",
"authorize_url": "<string>",
"session_id": "<string>"
},
"billed_usage": {
"prompt_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_read_tokens": 123,
"cached_write_tokens": 123
},
"completion_tokens": 123,
"completion_tokens_details": {
"text_tokens": 123,
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123,
"image_tokens": 123,
"rejected_prediction_tokens": 123
},
"total_tokens": 123,
"tool_usage": {
"web_search": {
"num_requests": 123
}
},
"cost": {
"input_tokens_cost": 123,
"output_tokens_cost": 123,
"reasoning_tokens_cost": 123,
"citation_tokens_cost": 123,
"search_queries_cost": 123,
"request_cost": 123,
"total_cost": 123
}
}
}
}Authorizations
Bearer token authentication. Use your provider API key or Bifrost authentication token.
Virtual keys (prefixed with sk-bf-) can also be passed here.
Body
Model in provider/model format
"mistral/mistral-ocr-latest"
- Option 1
- Option 2
Show child attributes
Show child attributes
Optional unique identifier for the request
Fallback models in provider/model format
Whether to include base64-encoded images in the response
Specific page indices to process (0-based)
x >= 0Maximum number of images to extract per page
x >= 1Minimum image size in pixels to extract
x >= 1Format for extracted tables (e.g., "markdown", "html")
Whether to extract page headers
Whether to extract page footers
Granularity of confidence scores to include in the response
page, block, word, document Format for bounding box annotations. Supports text, json_object, and json_schema modes.
- Option 1
- Option 2
Show child attributes
Show child attributes
Format for document-level annotations. Supports text, json_object, and json_schema modes.
- Option 1
- Option 2
Show child attributes
Show child attributes
Custom prompt for document annotation
Response
Successful response
Model used to perform OCR
Processed pages with extracted content
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Document-level annotation if requested
Additional fields included in responses
Show child attributes
Show child attributes
Was this page helpful?

