Before you begin
- Create an account and deploy a model on SynapsAI Cloud.
- Create an API key scoped to that deployment.
- Copy the model ID from the Models page — this replaces OpenAI model names like
gpt-4o.
Environment variables
Set these in your shell or deployment environment:OPENAI_API_BASE and OPENAI_API_KEY (LangChain, LlamaIndex, many community tools) will route requests to SynapsAI automatically.
Python SDK
The officialsynapsai package mirrors the OpenAI Python client:
Endpoint mapping
SynapsAI also exposes additional endpoints for classification, reranking, video, and other Hugging Face pipeline tasks. See Supported tasks.
cURL example
Streaming
Add"stream": true to receive Server-Sent Events, the same as OpenAI:
Key differences from OpenAI
Framework integrations
Troubleshooting migration issues
Model not found— Use the SynapsAI model ID, not an OpenAI model name.Endpoint not supported— Confirm the pipeline task matches the endpoint. See Supported tasks.401/InvalidAPIKeyError— Verify the key is scoped to the model and passed asBearerauth.- Library still hits
api.openai.com— ConfirmOPENAI_API_BASEis set before the client initializes.

