curl --request POST \
--url https://revise.io/api/v1/prompt/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://revise.io/api/v1/prompt/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://revise.io/api/v1/prompt/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://revise.io/api/v1/prompt/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://revise.io/api/v1/prompt/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://revise.io/api/v1/prompt/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://revise.io/api/v1/prompt/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"conversation_id": "<string>",
"previous_prompt_id": "<string>",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"conversation_expires_at": "2023-11-07T05:31:56Z",
"message": {
"role": "assistant",
"content": "<string>",
"incomplete": true,
"citations": [
{
"id": "<string>",
"url": "<string>",
"title": "<string>",
"startIndex": 123,
"endIndex": 123
}
]
},
"continuation": {
"reasoning_state": "new",
"history_compacted": true,
"reason": "<string>"
},
"artifacts": [
{
"id": "<string>",
"format": "docx",
"filename": "<string>",
"content_type": "<string>",
"variant": "tracked_changes",
"sha256": "<string>",
"bytes": 123,
"download_url": "<string>",
"input_eligible": true,
"expires_at": "2023-11-07T05:31:56Z",
"prompt_id": "<string>",
"conversion_id": "<string>",
"encryption": {
"format": "jwe",
"alg": "RSA-OAEP-256",
"enc": "A256GCM",
"key_id": "<string>"
},
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"usage": {
"pricing_version": "local-v5-monthly-fees",
"platform": {
"tool_cpu_seconds": "1.000000",
"tool_cpu_rate_usd_per_second": "0.001000000"
},
"inference": {
"billed_by": "revise",
"input_tokens": 1200,
"cached_input_tokens": 400,
"cache_creation_input_tokens": 0,
"output_tokens": 200,
"web_search_requests": 1,
"web_search_unit": "calls"
},
"cost": {
"total_usd": "0.061000000",
"itemized": {
"base_fee_usd": "0.050000000",
"cpu_fee_usd": "0.001000000",
"inference_fee_usd": "0.010000000"
}
}
},
"metadata": {
"customer": "acme",
"environment": "production"
},
"inference": {
"provider": "openai",
"model": "<string>",
"billing": "revise"
},
"limits": {
"max_platform_cost_usd": "0.050000000",
"max_inference_cost_usd": "0.050000000",
"max_seconds": 123
},
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"api_key_id": "<string>",
"output_encrypted": true,
"comments": [
{
"root": {},
"replies": [
{}
],
"anchor": {},
"relatedSuggestionIds": [
"<string>"
]
}
],
"changes": [
{
"id": "<string>",
"kind": "<string>",
"blockIds": [
"<string>"
],
"commentThreadId": "<string>"
}
],
"content_expires_at": "2023-11-07T05:31:56Z",
"content_deleted_at": "2023-11-07T05:31:56Z",
"retention": {
"delete_after_webhook_id": "<string>"
},
"incomplete": true,
"stop_reason": "spending_limit"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Cancel a prompt
curl --request POST \
--url https://revise.io/api/v1/prompt/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://revise.io/api/v1/prompt/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://revise.io/api/v1/prompt/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://revise.io/api/v1/prompt/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://revise.io/api/v1/prompt/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://revise.io/api/v1/prompt/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://revise.io/api/v1/prompt/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"conversation_id": "<string>",
"previous_prompt_id": "<string>",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"conversation_expires_at": "2023-11-07T05:31:56Z",
"message": {
"role": "assistant",
"content": "<string>",
"incomplete": true,
"citations": [
{
"id": "<string>",
"url": "<string>",
"title": "<string>",
"startIndex": 123,
"endIndex": 123
}
]
},
"continuation": {
"reasoning_state": "new",
"history_compacted": true,
"reason": "<string>"
},
"artifacts": [
{
"id": "<string>",
"format": "docx",
"filename": "<string>",
"content_type": "<string>",
"variant": "tracked_changes",
"sha256": "<string>",
"bytes": 123,
"download_url": "<string>",
"input_eligible": true,
"expires_at": "2023-11-07T05:31:56Z",
"prompt_id": "<string>",
"conversion_id": "<string>",
"encryption": {
"format": "jwe",
"alg": "RSA-OAEP-256",
"enc": "A256GCM",
"key_id": "<string>"
},
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"usage": {
"pricing_version": "local-v5-monthly-fees",
"platform": {
"tool_cpu_seconds": "1.000000",
"tool_cpu_rate_usd_per_second": "0.001000000"
},
"inference": {
"billed_by": "revise",
"input_tokens": 1200,
"cached_input_tokens": 400,
"cache_creation_input_tokens": 0,
"output_tokens": 200,
"web_search_requests": 1,
"web_search_unit": "calls"
},
"cost": {
"total_usd": "0.061000000",
"itemized": {
"base_fee_usd": "0.050000000",
"cpu_fee_usd": "0.001000000",
"inference_fee_usd": "0.010000000"
}
}
},
"metadata": {
"customer": "acme",
"environment": "production"
},
"inference": {
"provider": "openai",
"model": "<string>",
"billing": "revise"
},
"limits": {
"max_platform_cost_usd": "0.050000000",
"max_inference_cost_usd": "0.050000000",
"max_seconds": 123
},
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"api_key_id": "<string>",
"output_encrypted": true,
"comments": [
{
"root": {},
"replies": [
{}
],
"anchor": {},
"relatedSuggestionIds": [
"<string>"
]
}
],
"changes": [
{
"id": "<string>",
"kind": "<string>",
"blockIds": [
"<string>"
],
"commentThreadId": "<string>"
}
],
"content_expires_at": "2023-11-07T05:31:56Z",
"content_deleted_at": "2023-11-07T05:31:56Z",
"retention": {
"delete_after_webhook_id": "<string>"
},
"incomplete": true,
"stop_reason": "spending_limit"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}TypeScript
import { ReviseClient } from "@reviseio/api";
const revise = new ReviseClient({ apiKey: process.env.REVISE_API_KEY! });
const result = await revise.prompts.cancel("prompt_id");
Authorizations
Revise API key from https://revise.io/console/api-keys. Send Authorization: Bearer .
Path Parameters
Response
Cancel work; no request body
queued, running, paused, succeeded, failed, cancelled Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Customer-facing settled charges and usage. Supplier costs, margins and internal reconciliation diagnostics are not exposed. Historical charges are never recalculated using current prices.
Show child attributes
Show child attributes
{
"pricing_version": "local-v5-monthly-fees",
"platform": {
"tool_cpu_seconds": "1.000000",
"tool_cpu_rate_usd_per_second": "0.001000000"
},
"inference": {
"billed_by": "revise",
"input_tokens": 1200,
"cached_input_tokens": 400,
"cache_creation_input_tokens": 0,
"output_tokens": 200,
"web_search_requests": 1,
"web_search_unit": "calls"
},
"cost": {
"total_usd": "0.061000000",
"itemized": {
"base_fee_usd": "0.050000000",
"cpu_fee_usd": "0.001000000",
"inference_fee_usd": "0.010000000"
}
}
}
Show child attributes
Show child attributes
{
"customer": "acme",
"environment": "production"
}
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Non-secret ID of the key that originally submitted this prompt; null when not recorded. Idempotent retries preserve the original key.
True disables continuation and reuse. Artifacts are encrypted for the supplied public key.
Omitted when disabled by the stored response_options. Otherwise returns the existing native schema.
Show child attributes
Show child attributes
Omitted when disabled by the stored response_options. Otherwise returns the existing native schema.
Show child attributes
Show child attributes
24 hours after terminal completion. Result content and new continuation become unavailable at this deadline.
Show child attributes
Show child attributes
True when the request returned a partial result.
Limit that ended further agent work. The current result is returned; successful partial results incur the base fee even without inference, plus actual billable usage.
spending_limit, time_limit