API reference · Prompts
Price or run a version from the dashboard
POST/api/account/prompts/{id}/testSigned in session
run false renders the version with the values and answers the most it could cost, sending nothing. run true sends it as a request by the account (free allowance, hold and settlement, monthly cap, freeze), under session prompts; its usage row names the version. Same origin.
Parameters
| Field | Type | What it is |
|---|---|---|
| id (path)required | string | pmpt_ id. |
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| version | integer or string | A number or a label. |
| variables | object | |
| model | string | |
| maxTokens | integer | Default 1024. |
| run | boolean | Default false. |
Example
{
"model": "antimatter/auto"
}Answer 200
The price, and with run the answer and what it was billed.
| Field | Type | What it is |
|---|---|---|
| version | integer | |
| model | string | |
| worstCaseMicros | integer | |
| messages | array of object | |
| messages[] | string | One of "system", "developer", "user", "assistant". |
| messages[] | string | Text with {{variables}}: two braces, a name, two braces. At most 64000 characters. |
| text | string | |
| costMicros | integer |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 402OpenAI shaped error.
- 404OpenAI shaped error.
- 429OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.