OpenAI Compatibility
Caesar provides OpenAI-compatible endpoints that let you use existing OpenAI client libraries to access Caesar’s research API. With minimal code changes, you can integrate Caesar into applications already using the OpenAI SDK.
This compatibility layer is useful for quick integration and testing. For full access to Caesar’s features, we recommend using the native Research API.
Getting started
To use Caesar with the OpenAI SDK:
- Point the base URL to
https://api.caesar.xyz/compat - Use your Caesar API key
- Use
caesar-researchas the model name
Python
TypeScript
cURL
Available endpoints
Both endpoints trigger Caesar’s research workflow. The last user message becomes the research query, and the response includes synthesized findings with citations.
Including files in research
Caesar extends the OpenAI chat completions format to support file attachments for document-grounded research. This is a two-step process:
Important: The fileData field must contain the Caesar file UUID returned from the upload endpoint, not base64 data or a URL. Files are only supported on /compat/chat/completions, not /compat/completions.
Python example with files
Research configuration
Caesar extends the OpenAI format with a metadata object for fine-tuning research behavior:
When metadata is omitted, Caesar uses auto mode to intelligently configure parameters based on your query. See Research Parameters for details.
Streaming
Enable streaming to receive results as Server-Sent Events:
Python
TypeScript
Response format
Responses follow the OpenAI format with Caesar’s research content:
Caesar appends a References section to responses with numbered citations linking to source URLs.
Supported parameters
Request fields
Response fields
Limitations
Usage statistics return 0 for all token fields. Caesar uses research-based pricing rather than token counting.
The n parameter is not supported. Responses always contain exactly one choice.
Tool/function calling is not supported. Caesar focuses on research synthesis rather than tool use.
File attachments only work with /compat/chat/completions, not the text completions endpoint.
Ignored parameters
These OpenAI parameters are accepted but have no effect:
logprobs,top_logprobslogit_biaspresence_penalty,frequency_penaltyresponse_formattools,tool_choiceuser
Error handling
Errors follow the OpenAI format:
For full access to Caesar’s features including real-time progress events, collections, and detailed research metadata, use the Research API directly.