AI Chat

Ask AI Chat

AI Chat API allows you to run your own prompt via API.

Prompt (required) - It will be your query - please be as descriptive as possible to get an accurate output

assistantType (default: general) - Allow values are - general, researcher, marketer, sales, recruiter

mediaIds (required) - You can pass multiple mediaIds to run your prompt OR pass a single mediaId in an array

Request rules. prompt is the only field you must send. assistantTemplateId becomes required when you set assistantType to custom; for every other value it is optional. You do not have to send folderId or mediaIds: a body with only prompt is accepted. Send one of them anyway, or the assistant has no material to read.

Streaming. Send isStream: true to get the answer as Server-Sent Events instead of one JSON body. The response comes back as text/event-stream with Cache-Control: no-cache and Connection: keep-alive. Every frame is written as data: <json> followed by a blank line, with no event: or id: field, so read them as default message events. The stream ends on an end frame, or an error frame if it failed, and there is no [DONE] sentinel. The end frame carries promptId, messageId and references, the same references array the non-streaming response returns, so a streaming client can show the sources without a second request. isStream: true cannot be combined with isIndividualPrompt: true; that returns 400 with errorCode STREAMING_NOT_SUPPORTED_FOR_INDIVIDUAL.

Audio and video analysis. Send analysisMediaId and analysisInput together to have the model take in the recording itself rather than only its transcript. analysisMediaId must be one of mediaIds. This is a premium feature billed in credits per hour of media on top of the normal chat cost, so price it with GET /prompt/analysisQuote before you commit to a run. When the file turns out to be ineligible the chat still answers from the transcript rather than failing, and no analysis credits are charged.

post/prompt

Request

  • Base URL: https://api.speakai.co/v1
  • URL: https://api.speakai.co/v1/prompt
  • Auth: API key in header x-speakai-key and API key in header x-access-token

Request body

promptstring required

The question or instruction you want the AI to answer. Send a non-empty string, and be specific to get a useful answer. Required. the schema.required rejects an empty string. No maximum length.

isStreamboolean

Set this to true to stream the answer back as Server-Sent Events instead of waiting for one JSON response. Optional. Schema default is false, but see the note on defaults. When true, send an Accept header of text/event-stream. Cannot be combined with isIndividualPrompt set to true: the route returns 400 with errorCode STREAMING_NOT_SUPPORTED_FOR_INDIVIDUAL.

folderIdstring

The folder you want the AI to read from. Everything in that folder becomes the context for your prompt. Optional. Accepts an empty string or null. Schema default is an empty string.

mediaIdsstring[]

The specific media items you want the AI to read. Pass one or more media ids, even when you only have one. Optional. Accepts null and an empty array. No item cap and no per-item length limit.

folderIdsstring[]

Several folders you want the AI to read from at once. Use this instead of folderId when the context spans more than one folder. Optional. Accepts null and an empty array. No item cap. No default.

assistantType'researcher' | 'marketer' | 'sales' | 'general' | 'recruiter' | 'custom'

The assistant persona that shapes the answer. Optional, and restricted to the values listed here: any other string is rejected, and so is an empty string. Omit it to use the default persona saved on your user profile, which falls back to "general" when you have not saved one. Speak resolves that fallback when it creates the chat, so it fixes the persona for the whole conversation. Sending "custom" makes assistantTemplateId required.

assistantTemplateIdstring

The id of your custom assistant template. Send this when you set assistantType to "custom". Conditionally required: required when assistantType is "custom", otherwise optional, accepts an empty string, and carries a schema default of an empty string. Does not accept null in either branch.

tagsstring[]

Tags that narrow the media the AI reads to only items carrying those tags. Optional. Accepts null and an empty array. No item cap. No default.

speakersstring[]

Speaker names that narrow the transcript content the AI reads to only those speakers. Optional. Accepts null and an empty array. No item cap. No default.

promptIdstring

The id of an existing chat you want to continue. Leave it out to start a new chat. Optional. Accepts an empty string or null. Schema default is an empty string.

fieldIdstring

A single field you want the AI to fill or reference. Optional. Accepts an empty string. Does not accept null. No default.

fieldIdsstring[]

Several fields you want the AI to fill or reference. Optional. Accepts null. Schema default is null. Maximum 10 items, and each item is at most 200 characters.

isIndividualPromptboolean

Set this to true to run the prompt separately against each media item instead of once across all of them. Optional. Schema default is false. Cannot be combined with isStream set to true; that combination returns 400.

filtersobject

Extra filters that narrow which media the AI reads. Optional. Accepts null. The object's keys are not validated, so any object is accepted at the top level. No default.

startDatestring

Only include media created on or after this date. Optional. Send an ISO 8601 date string or a timestamp. Accepts null and carries a schema default of null.

endDatestring

Only include media created on or before this date. Optional. Send an ISO 8601 date string or a timestamp. Accepts null and carries a schema default of null.

modelId'gpt-3.5' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0125' | 'gpt-4' | 'gpt-4-1106-preview' | 'gpt-4-turbo' | 'gpt-4o-2024-05-13' | 'gpt-4o' | 'gpt-4o-mini' | 'gpt-4o-2024-08-06' | 'gpt-4o-mini-2024-07-18' | 'gpt-4.1-2025-04-14' | 'gpt-5.1-2025-11-13' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.5-thinking' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'claude-2' | 'claude-3-5-sonnet' | 'claude-3-5-sonnet-20241022' | 'claude-3-7-sonnet-latest' | 'claude-haiku-4-5' | 'claude-sonnet-4-6' | 'claude-sonnet-5' | 'claude-opus-4-8' | 'gemini-1.5-pro' | 'gemini-1.5-flash' | 'gemini-2.0-flash' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-3-flash-preview' | 'gemini-3.1-flash-lite' | 'gemini-3.1-pro-preview' | 'gemini-3.5-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'x-ai/grok-4.5' | 'z-ai/glm-5.2'

The language model you want to answer this chat. Leave it out, or send an empty string or null, to use your company default. The models Speak AI offers today are gemini-3.7-flash, gemini-3-flash-preview, gemini-3.5-flash, gemini-3.8-flash, gpt-5.6-terra, gpt-5.6-sol, gpt-5.5, gpt-5.4-mini-2026-03-17, claude-sonnet-5, claude-opus-4-8, claude-sonnet-4-6, x-ai/grok-4.5 and z-ai/glm-5.2. The full list below also holds older model ids that are still accepted so existing integrations keep working; treat those as deprecated and do not build against them.

analysisMediaIdstring

The media item you want the model to listen to or watch, instead of only reading its transcript. Optional. Accepts an empty string or null. Must also appear in mediaIds, and must be sent together with analysisInput. Sending one without the other is rejected with "analysisMediaId and analysisInput must be provided together". Sending an id that is not in mediaIds is rejected with "analysisMediaId must be one of mediaIds". Audio and video analysis is a premium feature: an account that is not enabled for it gets a 400. Call GET /prompt/analysisQuote first to check eligibility and price.

analysisInput'audio' | 'video'

What the model should take in for analysisMediaId. Send "audio" to have it hear the recording, or "video" to have it watch the file. Optional. Accepts an empty string or null. Must be sent together with analysisMediaId. Asking for "video" on an audio-only file analyzes the audio instead of failing, and the turn is charged at the audio rate. Asking for "audio" on a video extracts the audio track first, which makes the request run longer. Omit both fields for a normal transcript-only chat.

Response

OK

statusstring

Changes

No recorded changes to this operation across all 2 revisions of this API.