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
List AI models exposed by SaaSignal. Model IDs are normalized as provider:model strings.
curl https://api.saasignal.saastemly.com/infra/ai/models \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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
Get a single AI model definition.
curl https://api.saasignal.saastemly.com/infra/ai/models/{model_id} \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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.
model_id requiredList Models (OpenAI-Compatible)
List AI models exposed by SaaSignal. Model IDs are normalized as provider:model strings.
curl https://api.saasignal.saastemly.com/v1/models \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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)
Get a single AI model definition.
curl https://api.saasignal.saastemly.com/v1/models/{model_id} \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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
model_id requiredResponses
Generate text or multimodal outputs with canonical SaaSignal response routes or OpenAI-compatible aliases.
Create Response
Canonical AI response route. Accepts text and multimodal message content where the selected model supports it. Supports sync JSON, SSE streaming, and async: true.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/responses \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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.
modelinstructionsinputmessagesstreamfalseasyncfalsetemperaturemax_output_tokensresponse_formatresult_destinationwebhook_topicCreate Response (OpenAI-Compatible)
Canonical AI response route. Accepts text and multimodal message content where the selected model supports it. Supports sync JSON, SSE streaming, and async: true.
curl -X POST https://api.saasignal.saastemly.com/v1/responses \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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
modelinstructionsinputmessagesstreamfalseasyncfalsetemperaturemax_output_tokensresponse_formatresult_destinationwebhook_topicChat Completions Alias
OpenAI-compatible chat-completions alias that resolves through the same AI response service layer and billing path as /infra/ai/responses.
curl -X POST https://api.saasignal.saastemly.com/v1/chat/completions \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"messages":[]}'
{ "status": "ok" }
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
modelmessages requiredstreamfalseasyncfalsetemperaturemax_tokensresponse_formatresult_destinationwebhook_topicRealtime Sessions
Bootstrap short-lived browser/mobile credentials for realtime model sessions without exposing provider secrets.
Create Realtime Session
Mint a short-lived SaaSignal-managed realtime session descriptor without exposing provider credentials. Returns a proxy URL when realtime support is configured.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/realtime/sessions \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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.
modelttl_secondsvoiceCreate Realtime Session (OpenAI-Compatible)
Mint a short-lived SaaSignal-managed realtime session descriptor without exposing provider credentials. Returns a proxy URL when realtime support is configured.
curl -X POST https://api.saasignal.saastemly.com/v1/realtime/sessions \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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
modelttl_secondsvoiceRepresentations, Ranking & Safety
Generate embeddings, rerank candidates, and run neutral moderation classifiers.
Create Embeddings
Generate embedding vectors. Embeddings are returned only; SaaSignal does not auto-index text in v1.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/embeddings \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"input":{}}'
{ "status": "ok" }
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.
modelinput requiredCreate Embeddings (OpenAI-Compatible)
Generate embedding vectors. Embeddings are returned only; SaaSignal does not auto-index text in v1.
curl -X POST https://api.saasignal.saastemly.com/v1/embeddings \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"input":{}}'
{ "status": "ok" }
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
modelinput requiredRerank Documents
Reorder caller-supplied candidates. This route does not perform retrieval by itself.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/rerank \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"query":"...","documents":[]}'
{ "status": "ok" }
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.
modelquery requireddocuments requiredtop_nRun Moderation
Policy-neutral moderation and safety classification. No SaaSignal-hosted moderation profiles are persisted in v1.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/moderations \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"input":{}}'
{ "status": "ok" }
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.
modelinput requiredRun Moderation (OpenAI-Compatible)
Policy-neutral moderation and safety classification. No SaaSignal-hosted moderation profiles are persisted in v1.
curl -X POST https://api.saasignal.saastemly.com/v1/moderations \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"input":{}}'
{ "status": "ok" }
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
modelinput requiredAudio
Transcribe, translate, and synthesize audio using SaaSignal-managed billing and async operation tracking.
Transcribe Audio
Transcribe audio from multipart upload, storage reference, or base64 payloads. Supports async: true.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/audio/transcriptions \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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
modelpromptlanguagestorage_refbase64content_typenameasyncwebhook_topicTranscribe Audio (OpenAI-Compatible)
Transcribe audio from multipart upload, storage reference, or base64 payloads. Supports async: true.
curl -X POST https://api.saasignal.saastemly.com/v1/audio/transcriptions \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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
modelpromptlanguagestorage_refbase64content_typenameasyncwebhook_topicTranslate Audio
Translate audio from multipart upload, storage reference, or base64 payloads. Supports async: true.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/audio/translations \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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
modelpromptlanguagestorage_refbase64content_typenameasyncwebhook_topicTranslate Audio (OpenAI-Compatible)
Translate audio from multipart upload, storage reference, or base64 payloads. Supports async: true.
curl -X POST https://api.saasignal.saastemly.com/v1/audio/translations \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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
modelpromptlanguagestorage_refbase64content_typenameasyncwebhook_topicGenerate Speech
Generate speech audio from text. Small payloads can return inline audio; larger or async outputs can be written to Storage.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/audio/speech \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"input":"..."}'
{ "status": "ok" }
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
modelinput requiredvoiceresponse_formatjson, binarydefault jsonasyncfalseresult_destinationwebhook_topicGenerate Speech (OpenAI-Compatible)
Generate speech audio from text. Small payloads can return inline audio; larger or async outputs can be written to Storage.
curl -X POST https://api.saasignal.saastemly.com/v1/audio/speech \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"input":"..."}'
{ "status": "ok" }
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
modelinput requiredvoiceresponse_formatjson, binarydefault jsonasyncfalseresult_destinationwebhook_topicImages
Generate, edit, and vary images. Large or async outputs can be written directly into SaaSignal Storage.
Generate Images
Generate images from prompts. Canonical routes can also write assets to Storage destinations. Supports async: true.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/images/generations \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"prompt":"..."}'
{ "status": "ok" }
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
modelprompt requirednsize^\d+x\d+$stepsasyncfalseresult_destinationwebhook_topicGenerate Images (OpenAI-Compatible)
Generate images from prompts. Canonical routes can also write assets to Storage destinations. Supports async: true.
curl -X POST https://api.saasignal.saastemly.com/v1/images/generations \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"prompt":"..."}'
{ "status": "ok" }
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
modelprompt requirednsize^\d+x\d+$stepsasyncfalseresult_destinationwebhook_topicEdit Images
Edit an existing image using a prompt plus the source asset. Supports base64 or Storage references and async: true.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/images/edits \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"prompt":"...","image":{}}'
{ "status": "ok" }
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
modelprompt requirednsize^\d+x\d+$stepsasyncfalseresult_destinationwebhook_topicimage requiredEdit Images (OpenAI-Compatible)
Edit an existing image using a prompt plus the source asset. Supports base64 or Storage references and async: true.
curl -X POST https://api.saasignal.saastemly.com/v1/images/edits \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"prompt":"...","image":{}}'
{ "status": "ok" }
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
modelprompt requirednsize^\d+x\d+$stepsasyncfalseresult_destinationwebhook_topicimage requiredCreate Image Variations
Vary an existing image using a prompt plus the source asset. Supports base64 or Storage references and async: true.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/images/variations \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"prompt":"...","image":{}}'
{ "status": "ok" }
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
modelprompt requirednsize^\d+x\d+$stepsasyncfalseresult_destinationwebhook_topicimage requiredCreate Image Variations (OpenAI-Compatible)
Vary an existing image using a prompt plus the source asset. Supports base64 or Storage references and async: true.
curl -X POST https://api.saasignal.saastemly.com/v1/images/variations \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"prompt":"...","image":{}}'
{ "status": "ok" }
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
modelprompt requirednsize^\d+x\d+$stepsasyncfalseresult_destinationwebhook_topicimage requiredDocuments
Parse supported files into normalized blocks, then chunk text deterministically before embedding or search writes.
Parse Documents
Parse supported text and image documents into normalized layout-aware blocks. Supports multipart upload, Storage references, and async: true.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/documents/parse \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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
Deterministically chunk raw text or parsed blocks into retrieval-ready slices.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/documents/chunk \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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.
textblocksmax_charsoverlap_charsAsync Operations
Track queued AI work, inspect result destinations, and cancel supported long-running tasks.
Get AI Operation
Get the status and result metadata for an async AI operation.
curl https://api.saasignal.saastemly.com/infra/ai/operations/{operation_id} \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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.
operation_id requiredCancel AI Operation
Cancel an async AI operation that has not yet completed.
curl -X POST https://api.saasignal.saastemly.com/infra/ai/operations/{operation_id}/cancel \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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.
operation_id required