Skip to main content
This section provides runnable examples for SynapsAI Cloud inference across text, image, audio, video, and embedding pipelines. Before running examples:
  1. Deploy a model with the matching pipeline task.
  2. Create an API key scoped to that model.
  3. Set your API key: export SYNAPSAI_API_KEY="your-api-key"
  4. Replace model-id with your deployment’s model ID from the dashboard.
Use the Playground to test requests interactively and copy generated code.

Examples

Text generation

Chat completions, completions, and streaming.

Tool calling

Function calling with chat completions.

Embeddings

Generate vector embeddings for text.

Images

Generation, editing, detection, segmentation, and analysis.

Audio

Text-to-speech, speech-to-text, and translation.

Videos

Text-to-video and image-to-video generation.

Classification

Text, image, audio, and video classification — including zero-shot.

Rerank

Rerank documents by relevance to a query.

Fill mask

Masked language modeling predictions.

Feature extraction

Extract hidden-state features from inputs.
See Supported tasks for the full pipeline list and endpoint mapping.