Skip to content

Get a signed URL for a chat with history

POST
/ai/text/chat/contextual/signed
curl --request POST \
--url https://ai.work.optidata.cloud/api/ai/text/chat/contextual/signed \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "messages": [ { "role": "user", "content": "Reply with the single word OK." } ] }'

Stores the conversation for one hour and returns a signed URL that streams the assistant’s next answer when opened with GET, without an authentication key. See GET /ai/text/chat/contextual.

Media typeapplication/json
object
messages
required

The conversation so far, oldest first. The last entry is answered.

Array<object>
>= 1 items
object
role
required

Who wrote the message.

string
Allowed values: system user assistant
content
required

The message text.

string
Examples
Exampleconversation
{
"messages": [
{
"role": "user",
"content": "Reply with the single word OK."
}
]
}

A signed URL that streams the answer when opened with GET.

Media typeapplication/json
object
url
required

Open with GET, unchanged, within one hour.

string format: uri
Examples
Examplesigned
{
"url": "https://ai.work.optidata.cloud/api/ai/text/chat?owt1=1&request_guid=a305082f-f339-4825-9a40-144077d1f9fa&signature=3f9a0c1e7b5d4a2f8e6c9b1d0a7f3e5c2b8d4a6f1e9c7b3d5a0f2e8c6b4d1a9f"
}

No authentication key was sent.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The authentication key is expired or not recognised. Get a fresh one and retry.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Exampleexpired
{
"error": "JWT passport expired: Passport expired"
}

The request body failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examplegenerated
{
"message": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}