/api/v1/chat/completions
Run text inference based on the supplied parameters. Supports multimodal inputs including text, images (image_url), audio (input_audio), video (video_url), and files (file) for compatible models. File inputs (PDF, DOCX, PPTX, XLSX, TXT, etc.) are automatically extracted to text before being sent to the model. Long running requests should use the streaming API by setting stream=true in your request.
Authentication: This endpoint accepts either a Bearer API key or a SIGN-IN-WITH-X header for x402 wallet-based authentication. The legacy X-Sign-In-With-X header is also accepted during migration. When using x402, a 402 Payment Required response indicates insufficient balance and includes top-up instructions.
Request
- Base URL: https://api.venice.ai
- URL: https://api.venice.ai/api/v1/chat/completions
- Auth: one of:
- HTTP bearer
- API key in header SIGN-IN-WITH-X
Headers
Supported compression encodings (gzip, br). Only applied when stream is false.
Request body
Example request
{
"logprobs": true,
"top_logprobs": 1,
"max_temp": 1.5,
"messages": [
{
"content": [
{
"text": "Why is the sky blue?",
"type": "text"
}
]
}
],
"min_p": 0.05,
"min_temp": 0.1,
"model": "zai-org-glm-5-1",
"prompt_cache_key": "random-string",
"prompt_cache_retention": "24h",
"repetition_penalty": 1.2,
"reasoning": {
"effort": "medium",
"summary": "auto"
},
"reasoning_effort": "medium",
"seed": 42,
"stop_token_ids": [
151643,
151645
],
"stream": true,
"temperature": 0.7,
"top_k": 40,
"top_p": 0.9,
"anon_user_id": "end-user-123",
"fallbacks": [
{
"model": "claude-opus-4-8"
}
],
"verbosity": "low",
"text": {
"verbosity": "low"
},
"venice_parameters": {
"enable_e2ee": true,
"enable_web_search": "off",
"enable_x_search": true
},
"response_format": {
"json_schema": {
"properties": {
"age": {
"type": "number"
},
"name": {
"type": "string"
}
},
"required": [
"name",
"age"
],
"type": "object"
},
"type": "json_schema"
}
}Response
OK
Example response
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "The sky appears blue because of the way Earth's atmosphere scatters sunlight. When sunlight reaches Earth's atmosphere, it is made up of various colors of the spectrum, but blue light waves are shorter and scatter more easily when they hit the gases and particles in the atmosphere. This scattering occurs in all directions, but from our perspective on the ground, it appears as a blue hue that dominates the sky's color. This phenomenon is known as Rayleigh scattering. During sunrise and sunset, the sunlight has to travel further through the atmosphere, which allows more time for the blue light to scatter away from our direct line of sight, leaving the longer wavelengths, such as red, yellow, and orange, to dominate the sky's color.",
"reasoning_content": null,
"role": "assistant",
"tool_calls": []
},
"stop_reason": null
}
],
"created": 1739928524,
"cost": {
"diem": 0,
"usd": 0.00042
},
"id": "chatcmpl-a81fbc2d81a7a083bb83ccf9f44c6e5e",
"model": "zai-org-glm-5-1",
"object": "chat.completion",
"prompt_logprobs": null,
"usage": {
"completion_tokens": 146,
"completion_tokens_details": null,
"prompt_tokens": 612,
"prompt_tokens_details": null,
"total_tokens": 758
},
"venice_parameters": {
"enable_e2ee": true,
"include_venice_system_prompt": true,
"include_search_results_in_stream": false,
"return_search_results_as_documents": false,
"web_search_citations": [],
"enable_web_search": "auto",
"enable_web_scraping": false,
"enable_web_citations": true,
"strip_thinking_response": true,
"disable_thinking": true,
"character_slug": "venice"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.