Install and authenticate
Create API keys
model in request bodies is your deployment id from Models.
Chat example
https://api.synapsai.cloud/{model_id}/... instead of /v1 — Custom image.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Authenticate and send inference against a deployment from Python, cURL, or an OpenAI-compatible client
pip install --upgrade synapsai-python
export SYNAPSAI_API_KEY="your-api-key"
from synapsai import SynapsAI
client = SynapsAI() # reads SYNAPSAI_API_KEY
curl https://api.synapsai.cloud/v1/models \
-H "Authorization: Bearer $SYNAPSAI_API_KEY"
model in request bodies is your deployment id from Models.
response = client.chat.completions.create(
model="your-model-id",
messages=[{"role": "user", "content": "Hello, how are you?"}],
)
print(response.choices[0].message.content)
stream = client.chat.completions.create(
model="your-model-id",
messages=[{"role": "user", "content": "Hello, how are you?"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
https://api.synapsai.cloud/{model_id}/... instead of /v1 — Custom image.
export OPENAI_API_KEY="$SYNAPSAI_API_KEY"
export OPENAI_API_BASE="https://api.synapsai.cloud/v1"