Advanced Features
The Run CC gateway passes advanced parameters, such as JSON Mode and function calling, directly to upstream providers.
JSON Mode
Use response_format to request JSON output.
curl https://runccai.store/v1/chat/completions \ -H "Authorization: Bearer runcc-..." \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4.1-flash", "response_format": {"type": "json_object"}, "messages": [ {"role": "system", "content": "Balas hanya dengan JSON."}, {"role": "user", "content": "Ambil nama dan umur: Budi berumur 30."} ] }'
from openai import OpenAI client = OpenAI(base_url="https://runccai.store/v1", api_key="runcc-...") response = client.chat.completions.create( model="deepseek-v4.1-flash", response_format={"type": "json_object"}, messages=[ {"role": "system", "content": "Balas hanya dengan JSON."}, {"role": "user", "content": "Ambil nama dan umur: Budi berumur 30."} ] )
import OpenAI from 'openai'; const client = new OpenAI({ baseURL: 'https://runccai.store/v1', apiKey: 'runcc-...' }); const response = await client.chat.completions.create({ model: 'deepseek-v4.1-flash', response_format: { type: 'json_object' }, messages: [ { role: 'system', content: 'Balas hanya dengan JSON.' }, { role: 'user', content: 'Ambil nama dan umur: Budi berumur 30.' } ] });
Function calling (Tools)
The tools and tool_choice parameters are supported for agent orchestration.
Model Support
This feature depends on the selected model. Make sure the model supports Tools, for example DeepSeek, Qwen, or GLM.
Streaming
The stream: true mode uses the same SSE protocol as OpenAI. The gateway includes stream_options.include_usage so token usage data is sent at the end of the stream.
curl https://runccai.store/v1/chat/completions \ -H "Authorization: Bearer runcc-..." \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4.1-flash", "stream": true, "messages": [{"role": "user", "content": "Halo dari Run CC!"}] }'
response = client.chat.completions.create( model="deepseek-v4.1-flash", stream=True, messages=[{"role": "user", "content": "Halo dari Run CC!"}] ) for chunk in response: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True)
const stream = await client.chat.completions.create({ model: 'deepseek-v4.1-flash', stream: true, messages: [{ role: 'user', content: 'Halo dari Run CC!' }] }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content || ''); }
Other Parameters
Standard OpenAI parameters (temperature, top_p, max_tokens, presence_penalty, frequency_penalty, stop, seed) are passed through unchanged.
© 2026 Run CC.