Create Chat Completion
Create a chat completion using various AI models. Compatible with the OpenAI Chat Completions format.
Web Search
Enable real-time web search by adding{ "type": "web_search" } to the tools array. Requesty translates this to each provider’s native web search format automatically.
PDF Support
Send PDFs using theinput_file content type. You can provide the PDF as either base64-encoded data or a URL.
Using Base64-Encoded PDF
Using PDF URL
Parameters
type: Must be"input_file"filename: The name of the PDF file (e.g.,"document.pdf")file_data: Either base64-encoded PDF content or a URL to the PDF file
Authorizations
API key for authentication
Body
An array of message objects with role and content
The model name. If omitted, defaults to openai/gpt-4o-mini.
"openai/gpt-4o-mini"
Maximum number of tokens to generate
Controls randomness of the output
Controls diversity of the output
Enable Server-Sent Events (SSE) streaming responses
Available tools for the model. Supports function tools for custom function calling and web_search for real-time web search.
Specifies how tool calling should be handled
For structured responses (some models only)