Only QUEUED
requests may be canceled.
Parameters
The ID of the async request.
Your Baseten API key, formatted with prefix Api-Key
(e.g. {"Authorization": "Api-Key abcd1234.abcd1234"}
).
Response
The ID of the async request.
Whether the request was canceled.
Additional details about whether the request was canceled.
Rate limits
Calls to the cancel async request status endpoint are limited to 20 requests per second . If this limit is exceeded, subsequent requests will receive a 429 status code.
Python (Model)
Python (Chain)
import requests
import os
model_id = ""
request_id = ""
# Read secrets from environment variables
baseten_api_key = os.environ[ "BASETEN_API_KEY" ]
resp = requests.delete(
f "https://model- { model_id } .api.baseten.co/async_request/ { request_id } " ,
headers = { "Authorization" : f "Api-Key { baseten_api_key } " }
)
print (resp.json())