Create a prompt token
POSThttps://api.one.blendvision.com/bv/aisk/v1/prompts/tokens
This API is used to create a prompt token for the further streaming prompt used.
Request
- application/json
Body
required
source objectrequired
setting object
Responses
- 200
- 400
- 401
- 403
- 500
- default
A successful response.
- application/json
- Schema
- Example (from schema)
Schema
token string
The token to prompt with the chatbot.
expires_in int32
Indicates the lifetime in seconds of the token.
expired_at date-time
Indicates the time when the token will be expired.
{
"token": "string",
"expires_in": 0,
"expired_at": "2024-07-29T15:51:28.071Z"
}
A bad request response.
The code
is 3
means got an invalid argument. There are more HTTP status code mappings listed on here and gRPC code on here.
- application/json
- Schema
- Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
A unauthenticated response.
The header authorization
was missing or unidentified.
- application/json
- Schema
- Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
A forbidden response.
It means that the provided authorization
did not have enough permission to access the resource or the API.
- application/json
- Schema
- Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
A server error response. There are more HTTP status code mappings listed on here.
- application/json
- Schema
- Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
An unexpected error response.
- application/json
- Schema
- Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Authorization: authorization
name: authorizationtype: apiKeydescription: Enter the token with Bearer schema prefix, eg. `Bearer <token-string>`in: header
- curl
- python
- go
- nodejs
- php
- CURL
curl -L 'https://api.one.blendvision.com/bv/aisk/v1/prompts/tokens' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'authorization: <API_KEY_VALUE>' \
-d '{
"source": {
"type": "PROMPT_TOKEN_SOURCE_TYPE_CHATBOT_ID",
"chatbot_id": "string",
"publish_token": "string"
},
"setting": {
"citation": {
"mode": "PROMPT_CITATION_MODE_ALL",
"user_id": "string"
}
}
}'
ResponseClear