快速结论
- Supports Chat Completions for low-friction SDK migration.
- Supports streaming and tool-calling for agent workflows.
- Stabilize system/messages parameters before production rollout.
关键参数
- model | string | 必填 | gemini-3-1-pro | - | Exact model identifier from ToAPIs.
- messages | object[] | 必填 | - | - | Conversation messages in chronological order.
- max_tokens | integer | 必填 | - | >=1 | Maximum output tokens.
- stream | boolean | 可选 | false | - | Enable SSE streaming output.
- tools | object[] | 可选 | - | - | Tool/function definitions for tool-calling.
常见错误
- 400 invalid_request_error: 触发=Missing fields or invalid payload types.; 修复=Validate model/messages/max_tokens schema.; 重试=Retry only after payload fix.
- 401 authentication_error: 触发=Missing or invalid API key.; 修复=Verify Authorization header and key scope.; 重试=Retry after authentication fix.

