Request Basics
messages
Type: array · Required: Yes (for chat models)
Your conversation history. The model reads all previous messages to understand context.
prompt
Type: string · Required: Yes (for text completion models)
Raw text for the model to continue. Used with legacy completion endpoints.
model
Type: string · Required: Optional (defaults to your account setting)
Which model to use for the request.
Output Control
temperature
Default: 1 · Range: 0–2
Controls the randomness of responses. Lower values produce focused, deterministic output; higher values make responses more varied and creative.
- Use
0for factual tasks, data extraction, structured output - Use
0.7–1.0for general-purpose tasks - Use
1.2+for creative writing, brainstorming
top_p
Default: 1 · Range: 0–1
Nucleus sampling — limits the model’s token selection to the top cumulative probability mass. 0.9 means only tokens covering 90% of the probability distribution are considered.
Avoid changing both
temperature and top_p at the same time. Adjust one or the other.top_k
Default: Model-specific · Range: [1, ∞)
Limits how many top tokens the model considers at each step. Supported by Anthropic, Google, and most open-source models.
OpenAI models do not support
top_k.n
Default: 1
Number of response variants to generate per request. Useful for comparing alternatives.
stream
Default: true
Enables streaming — tokens are returned as they are generated rather than waiting for the full response.
true— lower perceived latency, better UX for chat interfacesfalse— full response returned as a single object
stream_options
Default: null
Additional streaming configuration. Primarily used to include token usage statistics in the final chunk.
Length Control
max_tokens
Default: null
Maximum number of tokens in the response. When null, uses the model’s default limit. Setting this explicitly helps control costs and prevent runaway outputs.
max_completion_tokens
Default: null
OpenAI o-series equivalent of max_tokens. Covers both reasoning tokens and visible output tokens. Use this instead of max_tokens for o1, o3, and similar reasoning models.
stop
Default: null
Stop sequences — the model halts generation when it produces this string or any string in the array.
Repetition Penalties
frequency_penalty
Default: 0 · Range: -2 to 2
Penalizes tokens proportionally to how often they’ve already appeared. Positive values reduce repetition of the same words and phrases. Useful for long-form content generation.
presence_penalty
Default: 0 · Range: -2 to 2
Penalizes tokens that have appeared at all, regardless of frequency. Encourages the model to introduce new topics. Useful for open-ended creative tasks.
repetition_penalty
Default: 1.0 · Range: (0, 2]
Alternative repetition control used by many open-source models (Llama, Mistral, etc.). Values above 1.0 discourage repetition, below 1.0 encourage it.
This serves a similar purpose to
frequency_penalty but is used by different model families. OpenAI models do not support this parameter.Reproducibility
seed
Default: null
When set, makes responses deterministic — identical inputs with the same seed produce the same output (or very close to it). Ideal for testing, A/B comparisons, and debugging prompts.
Tools & Function Calling
tools
Default: null
Array of tool definitions the model can call. Each tool specifies a name, description, and parameters schema.
tool_choice
Default: "auto"
Controls whether and how the model calls tools.
parallel_tool_calls
Default: true
Allows the model to call multiple tools simultaneously in a single response. Disable if your tools have sequential dependencies or shared state.
function_call / functions
Deprecated
Legacy OpenAI function calling format. Use tools and tool_choice instead.
Token Probabilities
logprobs
Default: false
Returns the log-probabilities of output tokens. Useful for confidence analysis, classification tasks, and model calibration.
top_logprobs
Default: null · Range: 1–20
Number of alternative tokens (with their probabilities) to return at each position. Requires logprobs: true.
logit_bias
Default: null
Map of {token_id: bias} to increase or decrease the likelihood of specific tokens. Range: -100 (ban) to 100 (force). Rarely needed, but useful for restricting vocabulary or enforcing specific output formats.
Multimodality
modalities
Default: null
Output types to request. Use ["text", "audio"] for models that support audio output (e.g., gpt-4o-audio).
audio
Default: null
Audio output configuration. Works in conjunction with modalities: ["text", "audio"].
prediction
Default: null
Predicted outputs — provide the expected response in advance. The model confirms or corrects it, which can reduce latency and cost. Most effective for editing tasks where much of the text remains unchanged.
Reasoning
reasoning_effort
Default: "medium"
Controls the depth of reasoning for models that support chain-of-thought (e.g., o1, o3, Claude with extended thinking). Higher effort = more thinking tokens = better quality at higher cost.
thinking
Default: null
Native Anthropic parameter for Claude models with extended thinking. Enables a reasoning phase with a configurable token budget.
Prompt Caching
prompt_cache_key
Default: null
Explicit key for managing prompt cache. Requests sharing the same key and prefix reuse the cached computation, reducing cost on repeated calls with identical system prompts or context.
prompt_cache_retention
Default: null
TTL (in seconds) for how long the cached prompt prefix is retained. Useful for controlling cache lifecycle on high-frequency workloads.
Response Format
response_format
Default: null
Forces structured output. Use json_object for any valid JSON, or json_schema to enforce a specific schema.
Storage & Metadata
store
Default: null
Whether to save the request for later use (fine-tuning, evals) on the provider’s side. Supported by OpenAI.
metadata
Default: null
Arbitrary tags attached to the request. Useful for filtering in logs and analytics dashboards.
Infrastructure & Reliability
service_tier
Default: null
Request processing priority at the provider level. OpenAI supports "flex" for cheaper async processing with relaxed latency requirements.
max_retries
Default: null
Number of automatic retries on failure. Useful when working with less stable providers or during high-traffic periods.
extra_headers
Default: null
Additional HTTP headers passed to the provider. Used for provider-specific features not covered by standard parameters.
safety_identifier
Default: null
Identifier for provider-side safety systems. Relevant for specific enterprise integrations that require request tagging for moderation pipelines.
web_search_options
Default: null
Configuration for built-in web search. Available on 800+ models across all major providers.
AnyAPI-Specific Parameters
transforms
Default: []
Apply smart transformations to your messages before sending them to models.
"middle-out"— rearranges messages for better context utilization, especially useful for long conversations
models
Default: null
Specify fallback models in order of preference. If the first model fails or is unavailable, the next one is tried.
provider
Default: null
Fine-tune provider selection and behavior.
Model-Specific Behavior
Different model families support different parameter sets:
Models silently ignore parameters they don’t support — you can safely use the same parameter set across different models.
Parameter Recipes
Creative Writing
Code Generation
Data Extraction
Conversational AI
Parameter Validation
Unknown parameters
Models ignore parameters they don’t understand. You can use the same parameter set across different models without errors.Out-of-range values
AnyAPI clamps obviously invalid values:temperature: 3.0→temperature: 2.0top_p: 1.5→top_p: 1.0
Wrong types
Type mismatches cause errors:max_tokens: "100"— should be a numberstream: "true"— should be booleantrue