Connect in three minutes
Use the hosted API origin, create a scoped token, then send an OpenAI-compatible request where model is your Manyfold agent id.
- Base URL
-
https://api.manyfold.ai/api/v1
- Auth
-
Authorization: Bearer
- Recommended scope
-
chat.completions
- Create or choose an agent and copy its agt_ id.
- Create an API token in Settings -> API tokens.
- Call /chat/completions with Authorization: Bearer $MF_API_TOKEN.
Examples
Create a non-streaming turn
curl https://api.manyfold.ai/api/v1/chat/completions \
-H "Authorization: Bearer $MF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "agt_your_agent_id",
"messages": [
{ "role": "user", "content": "Summarize this repository." }
]
}'
Response
{
"object": "chat.completion",
"model": "agt_your_agent_id",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "..."
},
"finish_reason": "stop"
}
],
"metadata": {
"session_id": "cts_...",
"assistant_message_id": "..."
}
}
Streaming
Set stream to true to receive Server-Sent Events. The x-session-id response header identifies the Manyfold session.
curl -N https://api.manyfold.ai/api/v1/chat/completions \
-H "Authorization: Bearer $MF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "agt_your_agent_id",
"stream": true,
"stream_options": { "include_usage": true },
"messages": [
{ "role": "user", "content": "Write a short release note." }
]
}'
List recent conversations
curl "https://api.manyfold.ai/api/v1/conversations?limit=20" \
-H "Authorization: Bearer $MF_API_TOKEN"
Replay a conversation
curl "https://api.manyfold.ai/api/v1/conversations/cts_your_session_id/messages?order=asc" \
-H "Authorization: Bearer $MF_API_TOKEN"
Errors
Errors use an OpenAI-style envelope so compatible clients can handle auth and validation failures consistently.
{
"error": {
"message": "API token does not have chat.completions scope",
"type": "authentication_error",
"code": "invalid_api_key"
}
}
Full chat guide · Conversation guide