Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
OpenAI 互換 API のストリーミング チャットの例。
{ "model": "gpt-4.1", "messages": [ { "role": "user", "content": "Explain SSE streaming while streaming the answer." } ], "stream": true }
curl https://maas.apigo.ai/v1/chat/completions \ -H "Authorization: Bearer $YOUR API KEY" \ -H "Content-Type: application/json" \ -N \ -d '{ "model": "gpt-4.1", "messages": [ { "role": "user", "content": "Explain SSE streaming while streaming the answer." } ], "stream": true }'
from openai import OpenAI client = OpenAI( base_url="https://maas.apigo.ai/v1", api_key="<YOUR API KEY>", ) stream = client.chat.completions.create( model="gpt-4.1", messages=[ {"role": "user", "content": "Explain SSE streaming while streaming the answer."} ], stream=True, ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="")
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://maas.apigo.ai/v1", apiKey: process.env.YOUR API KEY, }); const stream = await client.chat.completions.create({ model: "gpt-4.1", messages: [ { role: "user", content: "Explain SSE streaming while streaming the answer." } ], stream: true }); for await (const chunk of stream) { const delta = chunk.choices[0]?.delta?.content; if (delta) process.stdout.write(delta); }
responses