docs · quickstart
Make your first request
Three steps and about three minutes. You'll stream a response from Synapse Flash, our fastest general model. Pick your language in any code block; the rest of the docs will follow.
Get an API key#
Sign up with email or GitHub. Your first key is created for you and shown once, so copy it somewhere safe. Free accounts get $5 of credit every month, no card needed.
Then export it in your shell. The SDKs read SYNAPSE_API_KEY automatically.
export SYNAPSE_API_KEY="syn_live_..."Install the SDK#
Official SDKs for Python 3.9+, Node 18+ and Go 1.22+. They're thin wrappers over plain HTTPS, so cURL works too.
pip install synapse-sdkMake your first call#
This streams tokens as they're generated. The first one should arrive in about 120ms.
from synapse import Synapse
client = Synapse() # reads SYNAPSE_API_KEY
stream = client.chat.create(
model="syn-flash",
messages=[{"role": "user", "content": "Explain latency in 8 words"}],
stream=True,
)
for chunk in stream:
print(chunk.delta, end="", flush=True)You should see something like:
text
Latency: the pause between asking and knowing.What next#
- Swap
syn-flashfor any model in the catalogue. Nothing else changes. - Learn how events are framed in Streaming.
- Let the model call your code with Function calling.
- Handle
429s gracefully: Errors and rate limits. - Estimate a month of traffic with the cost calculator.