Core chat interface, compatible with the OpenAI Chat Completions API format.
Supports 200+ AI models — just change the model parameter to switch between providers, with no other code changes needed.
Supported providers: OpenAI, Anthropic, Google, xAI, DeepSeek, Alibaba, Moonshot, and more.
Note: Streaming output (stream: true) cannot be previewed in the Playground. Use an SDK to test.
API Key obtained from the APIYI Console
Model name. APIYI supports 200+ models — just change the model name to switch between providers.
"gpt-4o"
"gpt-4o-mini"
"gpt-5-chat-latest"
"claude-sonnet-4-20250514"
"claude-opus-4-1-20250805"
"claude-3-5-haiku-20241022"
"gemini-2.5-pro"
"gemini-2.5-flash"
"gemini-2.0-flash"
"deepseek-r1"
"deepseek-v3-0324"
"grok-4-0709"
"grok-3"
"o4-mini"
"o3"
"qwen-max"
"glm-4-plus"
Array of conversation messages, supports multi-turn dialogue
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello, please introduce yourself."
}
]
Sampling temperature. Higher values (e.g., 0.8) make output more random, lower values (e.g., 0.2) make it more deterministic.
0 <= x <= 2Maximum number of tokens to generate. Different models have different limits.
x >= 1Nucleus sampling parameter. It is generally recommended not to modify both temperature and top_p.
0 <= x <= 1Number of completions to generate for each message.
x >= 1Whether to stream results. The Playground does not support streaming preview — use an SDK to test.
Stop sequence(s). Generation stops when this sequence is encountered. Up to 4.
Presence penalty. Positive values increase the likelihood of talking about new topics.
-2 <= x <= 2Frequency penalty. Positive values decrease the likelihood of repeating the same text verbatim.
-2 <= x <= 2A unique identifier for the end user, used for monitoring and abuse detection.
Successfully returned chat completion result