POST /v1/chat/completions HTTP/1.1
Host: llm.onerouter.pro
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 4143
{
"model": "google/gemini-3.1-pro-preview",
"messages": [
{
"role": "system",
"content": "You are a highly capable AI assistant with access to tools. Respond concisely and accurately."
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "Please analyze this image and tell me what you see, then search the web for related information.",
"cache_control": {
"type": "ephemeral"
}
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/280px-PNG_transparency_demonstration_1.png",
"detail": "high"
}
}
]
},
{
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_abc123",
"type": "function",
"function": {
"name": "web_search",
"arguments": "{\"query\": \"PNG transparency image format history\"}"
}
}
]
},
{
"role": "tool",
"tool_call_id": "call_abc123",
"content": "[{\"title\": \"PNG format overview\", \"url\": \"https://www.w3.org/TR/PNG/\", \"snippet\": \"PNG is a lossless image format supporting transparency.\"}]"
},
{
"role": "assistant",
"content": "Based on the image and search results, PNG (Portable Network Graphics) is a lossless format that supports alpha-channel transparency."
},
{
"role": "user",
"content": "Great! Now use the get_weather tool to check the weather in San Francisco."
}
],
"provider": {
"order": [
"openai",
"azure",
"amazon-bedrock",
"google-vertex"
],
"allow_fallbacks": true,
"require_parameters": true,
"data_collection": "allow",
"zdr": false,
"enforce_distillable_text": false,
"only": [
"openai",
"azure",
"amazon-bedrock",
"google-vertex"
],
"quantizations": [
"fp16",
"fp8",
"int8",
"int4"
],
"sort": "latency",
"preferred_min_throughput": {
"p50": 100,
"p75": 80,
"p90": 60,
"p99": 40
},
"preferred_max_latency": {
"p50": 2,
"p75": 3.5,
"p90": 5,
"p99": 10
}
},
"tools": [
{
"type": "function",
"function": {
"name": "web_search",
"description": "Search the web for real-time information on any topic.",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search query string"
},
"max_results": {
"type": "integer",
"description": "Maximum number of results to return",
"default": 5
}
},
"required": [
"query"
],
"additionalProperties": false
}
}
},
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather information for a specific location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name or coordinates, e.g. 'San Francisco, CA' or '37.7749,-122.4194'"
},
"units": {
"type": "string",
"enum": [
"metric",
"imperial",
"standard"
],
"description": "Unit system for temperature and wind speed",
"default": "metric"
},
"include_forecast": {
"type": "boolean",
"description": "Whether to include a 7-day forecast",
"default": false
}
},
"required": [
"location"
],
"additionalProperties": false
}
}
},
{
"type": "function",
"function": {
"name": "calculator",
"description": "Perform arithmetic and mathematical calculations.",
"parameters": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "A valid mathematical expression, e.g. '(2 + 3) * 4 / 2'"
}
},
"required": [
"expression"
],
"additionalProperties": false
}
}
}
],
"tool_choice": {
"type": "function",
"function": {
"name": "get_weather"
}
},
"parallel_tool_calls": true,
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "structured_response",
"strict": true,
"schema": {
"type": "object",
"properties": {
"summary": {
"type": "string",
"description": "A concise summary of the answer"
},
"details": {
"type": "array",
"items": {
"type": "string"
},
"description": "A list of detailed points"
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Confidence score between 0 and 1"
},
"sources": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
}
},
"required": [
"title",
"url"
]
}
}
},
"required": [
"summary",
"details",
"confidence"
],
"additionalProperties": false
}
}
},
"reasoning": {
"effort": "none",
"max_tokens": 1024
},
"temperature": 0.7,
"top_p": 0.9,
"frequency_penalty": 0.3,
"presence_penalty": 0.2,
"max_completion_tokens": 4096,
"max_tokens": 4096,
"seed": 42,
"stop": [
"\n\nHuman:",
"\n\nUser:",
"###END###",
"<|end|>"
],
"logprobs": true,
"top_logprobs": 5,
"logit_bias": {
"198": -50,
"1234": 10,
"5678": 15,
"50256": -100
},
"stream": false,
"stream_options": {
"include_usage": true
},
"usage": {
"include": true
}
}