curl --request POST \
--url https://api.example.com/inference/v1{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [],
"timeout": 123,
"temperature": 123,
"top_p": 123,
"n": 123,
"stop": "<string>",
"max_completion_tokens": 123,
"max_tokens": 123,
"modalities": [
"<unknown>"
],
"presence_penalty": 123,
"frequency_penalty": 123,
"stream": true,
"logit_bias": {},
"user": "<string>",
"response_format": {},
"seed": 123,
"tools": [
"<unknown>"
],
"tool_choice": "<string>",
"logprobs": true,
"top_logprobs": 123,
"parallel_tool_calls": true,
"extra_headers": {},
"functions": [
"<unknown>"
],
"function_call": "<string>",
"api_version": "<string>",
"prompt": "<string>",
"template_vars": {},
"vertex_credentials": "<string>"
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}OpenAI-compatible APIs.
curl --request POST \
--url https://api.example.com/inference/v1{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [],
"timeout": 123,
"temperature": 123,
"top_p": 123,
"n": 123,
"stop": "<string>",
"max_completion_tokens": 123,
"max_tokens": 123,
"modalities": [
"<unknown>"
],
"presence_penalty": 123,
"frequency_penalty": 123,
"stream": true,
"logit_bias": {},
"user": "<string>",
"response_format": {},
"seed": 123,
"tools": [
"<unknown>"
],
"tool_choice": "<string>",
"logprobs": true,
"top_logprobs": 123,
"parallel_tool_calls": true,
"extra_headers": {},
"functions": [
"<unknown>"
],
"function_call": "<string>",
"api_version": "<string>",
"prompt": "<string>",
"template_vars": {},
"vertex_credentials": "<string>"
}
'{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Reference to a Weave Prompt object (e.g., 'weave:///entity/project/object/prompt_name:version'). If provided, the messages from this prompt will be prepended to the messages in this request. Template variables in the prompt messages can be substituted using the template_vars parameter.
Dictionary of template variables to substitute in prompt messages. Variables in messages like '{variable_name}' will be replaced with the corresponding values. Applied to both prompt messages (if prompt is provided) and regular messages.
JSON string of Vertex AI service account credentials. When provided for vertex_ai models (e.g. vertex_ai/gemini-2.5-pro), used for authentication instead of api_key. Not persisted in trace storage.
Successful Response
Was this page helpful?