Documentation Index
Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt
Use this file to discover all available pages before exploring further.
Recommended endpoints
Minimal request
{
"model": "gpt-4.1",
"messages": [
{ "role": "user", "content": "Explain SSE streaming while streaming the answer." }
],
"stream": true
}
cURL example
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
}'
Python example
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="")
Node.js example
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);
}
Best practices
- Render incrementally from streamed chunks
- Consider
responses streaming if you will later add tools or structured output
- Handle reconnection and chunk assembly on the server