AI
Atomic AI primitives for inference, embeddings, reranking, moderation, realtime sessions, document preparation, and async operation tracking. Keep threads, prompts, application memory, and source-of-truth records in your own SQL schema, then use Decisioning Search when you need managed retrieval.
/infra/ai/* for the native SaaSignal contract. Use /v1/* aliases when you need OpenAI-compatible wire shapes for existing client code.Model Catalog
Discover normalized provider:model identifiers, capability flags, modality support, limits, and pricing metadata.
List AI Models
const { data } = await ss.infra.ai.models.list()
- Open Dashboard → AI and select your project
- Go to the Catalog workspace
- Browse the normalized model catalog, compare capabilities, and copy the exact `provider:model` identifier you want to use in code.
Get AI Model
const model = await ss.infra.ai.models.get('workers-ai:llama-3.1-8b-instruct')
- Open Dashboard → AI and select your project
- Go to the Catalog workspace
- Find the model card that matches your use case, then inspect pricing, modalities, and supported features before wiring requests against it.
List Models (OpenAI-Compatible)
const models = await fetch(`${baseUrl}/v1/models`, { headers: { Authorization: `Bearer ${token}` } }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose GET /v1/models from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Get Model (OpenAI-Compatible)
const model = await fetch(`${baseUrl}/v1/models/workers-ai:llama-3.1-8b-instruct`, { headers: { Authorization: `Bearer ${token}` } }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose GET /v1/models/{model_id} from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Responses
Generate text or multimodal outputs with canonical SaaSignal response routes or OpenAI-compatible aliases.
Create Response
const result = await ss.infra.ai.responses.create({ model: 'workers-ai:llama-3.1-8b-instruct', input: 'Write a release note for the new AI primitive.' })
- Open Dashboard → AI and select your project
- Go to the Studio workspace
- Use the Responses card to run a synchronous prompt or queue the request as an async operation when you want to test the native SaaSignal response surface.
Create Response (OpenAI-Compatible)
const result = await fetch(`${baseUrl}/v1/responses`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:llama-3.1-8b-instruct', input: 'Summarize the deployment impact.' }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/responses from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Chat Completions Alias
const result = await ss.infra.ai.responses.chatCompletions({ model: 'workers-ai:llama-3.1-8b-instruct', messages: [{ role: 'user', content: 'Explain why decisioning search indexes are not app databases.' }] })
- Open Dashboard → API Console and select your project
- Choose POST /v1/chat/completions from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Realtime Sessions
Bootstrap short-lived browser/mobile credentials for realtime model sessions without exposing provider secrets.
Create Realtime Session
const session = await ss.infra.ai.realtime.createSession({ model: 'workers-ai:llama-3.1-8b-instruct', ttl_seconds: 900, voice: 'alloy' })
- Open Dashboard → AI and select your project
- Go to the Studio workspace
- Use the Realtime session card to mint short-lived browser credentials without ever handing provider secrets to the client.
Create Realtime Session (OpenAI-Compatible)
const session = await fetch(`${baseUrl}/v1/realtime/sessions`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:llama-3.1-8b-instruct', ttl_seconds: 900 }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/realtime/sessions from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Representations, Ranking & Safety
Generate embeddings, rerank candidates, and run neutral moderation classifiers.
Create Embeddings
const embeddings = await ss.infra.ai.embeddings.create({ model: 'workers-ai:bge-m3', input: 'Managed retrieval primitives for docs search' })
- Open Dashboard → AI and select your project
- Go to the Studio workspace
- Generate vectors from the Embeddings card, then feed those vectors into the Retrieval tab yourself because SaaSignal keeps embedding and index writes intentionally separate.
Create Embeddings (OpenAI-Compatible)
const embeddings = await fetch(`${baseUrl}/v1/embeddings`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:bge-m3', input: 'Managed retrieval primitives for docs search' }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/embeddings from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Rerank Documents
const reranked = await ss.infra.ai.rerank.create({ model: 'workers-ai:bge-reranker-base', query: 'Which guide explains async AI operations?', documents: ['Use /infra/ai/operations/:operation_id to inspect state.', 'Indexes auto-embed text on upsert.'] })
- Open Dashboard → AI and select your project
- Go to the Studio workspace
- Open the Rerank card, provide a query plus newline-separated candidate documents, and inspect the returned order and scores.
Run Moderation
const result = await ss.infra.ai.moderations.create({ model: 'workers-ai:llama-guard-3-8b', input: 'Review this user message for policy flags.' })
- Open Dashboard → AI and select your project
- Go to the Studio workspace
- Use the Moderation card to run a neutral classifier before you decide how your application policy should respond.
Run Moderation (OpenAI-Compatible)
const result = await fetch(`${baseUrl}/v1/moderations`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:llama-guard-3-8b', input: 'Review this user message for policy flags.' }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/moderations from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Audio
Transcribe, translate, and synthesize audio using SaaSignal-managed billing and async operation tracking.
Transcribe Audio
const result = await ss.infra.ai.audio.transcribe({ model: 'workers-ai:whisper-large-v3-turbo', storage_ref: { bucket_id: 'sb_audio', key: 'calls/demo.wav' } })
- Open Dashboard → API Console and select your project
- Choose POST /infra/ai/audio/transcriptions from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Transcribe Audio (OpenAI-Compatible)
const result = await fetch(`${baseUrl}/v1/audio/transcriptions`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:whisper-large-v3-turbo', storage_ref: { bucket_id: 'sb_audio', key: 'calls/demo.wav' } }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/audio/transcriptions from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Translate Audio
const result = await ss.infra.ai.audio.translate({ model: 'workers-ai:whisper-large-v3-turbo', storage_ref: { bucket_id: 'sb_audio', key: 'calls/es-demo.wav' } })
- Open Dashboard → API Console and select your project
- Choose POST /infra/ai/audio/translations from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Translate Audio (OpenAI-Compatible)
const result = await fetch(`${baseUrl}/v1/audio/translations`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:whisper-large-v3-turbo', storage_ref: { bucket_id: 'sb_audio', key: 'calls/es-demo.wav' } }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/audio/translations from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Generate Speech
const speech = await ss.infra.ai.audio.speech({ model: 'workers-ai:melotts', input: 'Welcome to your AI control plane.', voice: 'alloy' })
- Open Dashboard → API Console and select your project
- Choose POST /infra/ai/audio/speech from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Generate Speech (OpenAI-Compatible)
const speech = await fetch(`${baseUrl}/v1/audio/speech`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:melotts', input: 'Welcome to your AI control plane.', voice: 'alloy' }) }).then((res) => res.arrayBuffer())
- Open Dashboard → API Console and select your project
- Choose POST /v1/audio/speech from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Images
Generate, edit, and vary images. Large or async outputs can be written directly into SaaSignal Storage.
Generate Images
const images = await ss.infra.ai.images.generate({ model: 'workers-ai:flux-1-schnell', prompt: 'Create a bold hero image for a serverless AI control plane.' })
- Open Dashboard → API Console and select your project
- Choose POST /infra/ai/images/generations from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Generate Images (OpenAI-Compatible)
const images = await fetch(`${baseUrl}/v1/images/generations`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:flux-1-schnell', prompt: 'Create a bold hero image for a serverless AI control plane.' }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/images/generations from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Edit Images
const result = await ss.infra.ai.images.edit({ model: 'workers-ai:flux-1-schnell', prompt: 'Add a futuristic control panel overlay.', image: { storage_ref: { bucket_id: 'sb_media', key: 'hero/original.png' } } })
- Open Dashboard → API Console and select your project
- Choose POST /infra/ai/images/edits from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Edit Images (OpenAI-Compatible)
const result = await fetch(`${baseUrl}/v1/images/edits`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:flux-1-schnell', prompt: 'Add a futuristic control panel overlay.', image: { storage_ref: { bucket_id: 'sb_media', key: 'hero/original.png' } } }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/images/edits from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Create Image Variations
const result = await ss.infra.ai.images.variations({ model: 'workers-ai:flux-1-schnell', prompt: 'Generate alternate campaign directions.', image: { storage_ref: { bucket_id: 'sb_media', key: 'hero/original.png' } } })
- Open Dashboard → API Console and select your project
- Choose POST /infra/ai/images/variations from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Create Image Variations (OpenAI-Compatible)
const result = await fetch(`${baseUrl}/v1/images/variations`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'workers-ai:flux-1-schnell', prompt: 'Generate alternate campaign directions.', image: { storage_ref: { bucket_id: 'sb_media', key: 'hero/original.png' } } }) }).then((res) => res.json())
- Open Dashboard → API Console and select your project
- Choose POST /v1/images/variations from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Documents
Parse supported files into normalized blocks, then chunk text deterministically before embedding or search writes.
Parse Documents
const parsed = await ss.infra.ai.documents.parse({ storage_ref: { bucket_id: 'sb_docs', key: 'manuals/architecture.pdf' }, async: true })
- Open Dashboard → API Console and select your project
- Choose POST /infra/ai/documents/parse from the route list
- Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console
Chunk Documents
const chunks = await ss.infra.ai.documents.chunk({ text: 'Atomic AI primitives keep SQL as the source of truth.', max_chars: 240, overlap_chars: 40 })
- Open Dashboard → AI and select your project
- Go to the Studio workspace
- Use the Document chunking card to split text deterministically before embedding or index writes.
Async Operations
Track queued AI work, inspect result destinations, and cancel supported long-running tasks.
Get AI Operation
const operation = await ss.infra.ai.operations.get('aiop_123')
- Open Dashboard → AI and select your project
- Go to the Operations workspace
- Paste an operation ID into the inspector to review state transitions, usage, result destinations, and any failure payload.
Cancel AI Operation
const operation = await ss.infra.ai.operations.cancel('aiop_123')
- Open Dashboard → AI and select your project
- Go to the Operations workspace
- Inspect the queued or processing operation first, then use the cancel action when the generating task should stop before finalization.