Skip to main content
Start with the task, then confirm the model ID, request protocol, and required capabilities with your deployment administrator. The model list discovers models visible to the current key; appearing in that list does not mean a model supports every endpoint or parameter below.

Choose an endpoint by task

This table points to existing guides; it is not a provider model capability catalog. Words such as chat or vision in a model name cannot replace capability verification.

Switching between Chat Completions and Responses

When switching endpoints, update the request body, tool result structure, response reader, and stream completion checks together. Replacing /chat/completions with /responses in the URL is insufficient. Do not assume equivalent conversion is available for every channel. Confirm server-managed conversations, built-in tools, and resource management separately; these examples do not promise those features on every deployment.

Minimal validation sequence

  1. Confirm the actual API address using API basics, then list models with the same key.
  2. Send a minimal request from the matching guide without combining tools, images, and structured output immediately.
  3. Check business completion and output content, not only HTTP 200.
  4. Enable capabilities one at a time. Keep request times, model IDs, and non-sensitive error details to compare with deployment logs.
  5. Validate interrupted streams, failures, and retry policy. Automatic client retries are not a capability probe.

Common misconceptions

  • The SDK has a method, so the gateway must support it. SDKs can expose endpoints outside this site’s scope. Check the API overview and your deployment.
  • An image generation model must support editing. Image input, editing, and generation are separate capabilities to verify.
  • Parsable JSON meets the business requirements. Validate field types, values, and business constraints, and handle refusals and incomplete responses.
  • The top search result is sufficient to answer. Check relevance, access, and evidence supporting the answer; see RAG.
Use errors and retries to diagnose failed requests. Arbitrarily changing models can conceal protocol or parameter incompatibilities.

Native protocols and streaming tools

Claude Messages and Gemini generateContent provide dedicated native protocol examples. For argument assembly and function execution, see Chat / Responses streaming tools. Runnable native SSE and tool loops for Claude and Gemini include completion validation and signature preservation.

Look up one model

When you know the model ID, run examples/model.py. It checks business errors inside HTTP 200 and exits unsuccessfully for missing or unavailable models without printing the full error payload. Install the Python example dependencies and configure the address, token, and model for the same deployment. See model retrieval for path encoding limits.
阅读中文 Model routing · Rate limits · Observability · AI SDK Prompt caching · Reasoning models · Context management

Native Gemini tools

Confirm each native tool on the selected channel: googleSearch, urlContext, codeExecution. Model discovery, function-calling support, and tool-field acceptance do not prove built-in execution. Check grounding, URL status, or execution-result evidence separately.