curl --request DELETE \
--url https://openrouter.ai/api/v1/interns/{internId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"acknowledge_workspace_loss": true
}
'import requests
url = "https://openrouter.ai/api/v1/interns/{internId}"
payload = { "acknowledge_workspace_loss": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({acknowledge_workspace_loss: true})
};
fetch('https://openrouter.ai/api/v1/interns/{internId}', 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://openrouter.ai/api/v1/interns/{internId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'acknowledge_workspace_loss' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openrouter.ai/api/v1/interns/{internId}"
payload := strings.NewReader("{\n \"acknowledge_workspace_loss\": true\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://openrouter.ai/api/v1/interns/{internId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"acknowledge_workspace_loss\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/v1/interns/{internId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"acknowledge_workspace_loss\": true\n}"
response = http.request(request)
puts response.read_body{
"deleting": true
}{
"error": {
"code": 400,
"message": "Invalid request body",
"metadata": {
"reason": "invalid_body",
"retryable": false
}
}
}{
"error": {
"code": 401,
"message": "Invalid or missing API key"
}
}{
"error": {
"code": 403,
"message": "Forbidden"
}
}{
"error": {
"code": 404,
"message": "Intern not found",
"metadata": {
"reason": "not_found",
"retryable": false
}
}
}{
"error": {
"code": 408,
"message": "Operation timed out after 10s. Please try again later.",
"metadata": {
"reason": "timeout",
"retryable": true
}
}
}{
"error": {
"code": 409,
"message": "Another operation holds the intern, retry once it settles",
"metadata": {
"reason": "intern_busy",
"retryable": true
}
}
}{
"error": {
"code": 413,
"message": "Request body exceeds 1048576 bytes",
"metadata": {
"reason": "payload_too_large",
"retryable": false
}
}
}{
"error": {
"code": 415,
"message": "Request body must be sent as application/json",
"metadata": {
"reason": "unsupported_media_type",
"retryable": false
}
}
}{
"error": {
"code": 500,
"message": "The request could not be completed",
"metadata": {
"reason": "internal_error",
"retryable": true
}
}
}{
"error": {
"code": 502,
"message": "The intern service could not be reached, retry the request",
"metadata": {
"reason": "upstream_unavailable",
"retryable": true
}
}
}Delete an intern
Starts safe teardown of the intern, its runtime and its private vault. The body is optional. Send {"acknowledge_workspace_loss": true} to delete a destroy_failed intern whose last_failure_message names workspace_archive_failed, accepting that its workspace is not backed up. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare Content-Type: application/json or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern’s own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as eu.openrouter.ai are refused. API key required.
curl --request DELETE \
--url https://openrouter.ai/api/v1/interns/{internId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"acknowledge_workspace_loss": true
}
'import requests
url = "https://openrouter.ai/api/v1/interns/{internId}"
payload = { "acknowledge_workspace_loss": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({acknowledge_workspace_loss: true})
};
fetch('https://openrouter.ai/api/v1/interns/{internId}', 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://openrouter.ai/api/v1/interns/{internId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'acknowledge_workspace_loss' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openrouter.ai/api/v1/interns/{internId}"
payload := strings.NewReader("{\n \"acknowledge_workspace_loss\": true\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://openrouter.ai/api/v1/interns/{internId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"acknowledge_workspace_loss\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/v1/interns/{internId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"acknowledge_workspace_loss\": true\n}"
response = http.request(request)
puts response.read_body{
"deleting": true
}{
"error": {
"code": 400,
"message": "Invalid request body",
"metadata": {
"reason": "invalid_body",
"retryable": false
}
}
}{
"error": {
"code": 401,
"message": "Invalid or missing API key"
}
}{
"error": {
"code": 403,
"message": "Forbidden"
}
}{
"error": {
"code": 404,
"message": "Intern not found",
"metadata": {
"reason": "not_found",
"retryable": false
}
}
}{
"error": {
"code": 408,
"message": "Operation timed out after 10s. Please try again later.",
"metadata": {
"reason": "timeout",
"retryable": true
}
}
}{
"error": {
"code": 409,
"message": "Another operation holds the intern, retry once it settles",
"metadata": {
"reason": "intern_busy",
"retryable": true
}
}
}{
"error": {
"code": 413,
"message": "Request body exceeds 1048576 bytes",
"metadata": {
"reason": "payload_too_large",
"retryable": false
}
}
}{
"error": {
"code": 415,
"message": "Request body must be sent as application/json",
"metadata": {
"reason": "unsupported_media_type",
"retryable": false
}
}
}{
"error": {
"code": 500,
"message": "The request could not be completed",
"metadata": {
"reason": "internal_error",
"retryable": true
}
}
}{
"error": {
"code": 502,
"message": "The intern service could not be reached, retry the request",
"metadata": {
"reason": "upstream_unavailable",
"retryable": true
}
}
}Authorizations
API key as bearer token in Authorization header
Path Parameters
ID of an intern visible to the authenticated API key.
1"7c9e6679-7425-40de-944b-e07fc1f90ae7"
Body
Optional consent for a teardown that discards the workspace.
Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing.
Response
The operation was accepted.