The Speak AI API exposes 2 ai chat endpoints under the base URL https://api.speakai.co/v1. Every request needs the x-speakai-key and x-access-token headers described in Authentication.
Fetch all your Speak AI Chat Responses.
What can you do with the ai chat endpoints?
Speak AI groups these 2 endpoints under the ai chat resource. Each entry below links to the full reference for that endpoint further down this page.
All AI Chats
/promptGet AI Chat History.
curl -X GET 'https://api.speakai.co/v1/prompt' \
-H 'x-speakai-key: sk_test_speak_0000000000000000' \
-H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000'200 OK
Response body, application/json.
| Field | Type |
|---|---|
status |
string |
data |
object |
data.totalCount |
integer |
data.pages |
integer |
data.history |
object[] |
Deeper nested fields are not listed. See the example response below for the full shape.
Example response (List of Prompts), application/json. Arrays are shortened to one entry and long strings are cut.
{
"status": "success",
"data": {
"totalCount": 2,
"pages": 1,
"history": [
{
"id": "64b04ce76db5f05cba07a3ff",
"prompt": "Identify the top 5 action items to prioritize for maximum impact",
"answer": "",
"createdAt": "2023-07-13T19:13:43.953Z",
"assistantType": "general",
"mediaName": "How To Upload A Video File On Desktop",
"mediaIds": [
"de737309a4e9"
],
"state": "failed",
"link": "https://app.speakai.co/media/insight/MEDIA_URL"
}
]
}
}Ask AI Chat
/promptAI 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 body
Field types and names come from the request body the spec records. The spec does not mark request body fields as required, so read this as the shape the endpoint accepts rather than a required field list.
| Field | Type |
|---|---|
prompt |
string |
mediaIds |
string[] |
assistantType |
string |
curl -X POST 'https://api.speakai.co/v1/prompt' \
-H 'x-speakai-key: sk_test_speak_0000000000000000' \
-H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "Tell me how my speaking pace was. Did I speak too fast, at a good pace or too slowly? A good pace is between 140 and 170 words per minute. Less than 140 words per minute is too slow and more than 170",
"mediaIds": [
"923884998a91"
],
"assistantType": "general"
}'200 OK
Response body, application/json.
| Field | Type |
|---|---|
status |
string |
data |
object |
data.state |
string |
data.answer |
string |
data.totalMedia |
integer |
data.references |
any[] |
Example response (Success Response), application/json. Arrays are shortened to one entry and long strings are cut.
{
"status": "success",
"data": {
"state": "completed",
"answer": "Main discussion points:\n\n- The video demonstrates how to upload a video file through Speak.\n- The process involves signing in, accessing the dashboard, and hitting the upload butto...",
"totalMedia": 1,
"references": []
}
}Related pages
- API reference for the base URL, authentication, and the error format.
- Authenticate with the Speak AI API using access tokens
- Upload audio and video to Speak AI and read insights
- Create and update live transcription sessions in Speak AI
- Analyze text notes with the Speak AI text endpoints
Get an API key on the Speak AI developer page.