This org's runs, newest first.
curl --request GET \
--url https://api.spiral.ai/v1/runs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spiral.ai/v1/runs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spiral.ai/v1/runs', 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://api.spiral.ai/v1/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://api.spiral.ai/v1/runs"
req, _ := http.NewRequest("GET", 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.get("https://api.spiral.ai/v1/runs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spiral.ai/v1/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "run",
"status": "queued",
"provider": "<string>",
"model": "<string>",
"output": {
"items": [
{
"type": "image",
"url": "<string>",
"mime_type": "<string>",
"size_bytes": 0,
"width": 0,
"height": 0,
"duration_seconds": 123,
"kind": "<string>",
"data": "<unknown>",
"expires_at": "<string>",
"field": "<string>",
"source": "provider",
"notice": "<string>",
"error": {
"code": "OUTPUT_UNAVAILABLE",
"message": "<string>"
}
}
],
"expired": true,
"dropped_count": 0
},
"usage": {
"units": [
{
"unit": "<string>",
"quantity": 123
}
]
},
"cost": {
"currency": "USD",
"state": "held",
"estimated": {
"amount": "<string>",
"amount_micros": 0
},
"charged": {
"amount": "<string>",
"amount_micros": 0
}
},
"charge_reason": "provider_billed_failure",
"timings": {
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
]
},
"metadata": {},
"idempotency_key": "<string>",
"app": {
"id": "<string>",
"url": "<string>",
"title": "<string>"
},
"sequence": 1,
"links": {
"self": "<string>"
}
}
],
"next_cursor": "<string>",
"has_more": true
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}Runs
List runs
GET
/
v1
/
runs
This org's runs, newest first.
curl --request GET \
--url https://api.spiral.ai/v1/runs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spiral.ai/v1/runs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spiral.ai/v1/runs', 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://api.spiral.ai/v1/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://api.spiral.ai/v1/runs"
req, _ := http.NewRequest("GET", 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.get("https://api.spiral.ai/v1/runs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spiral.ai/v1/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "run",
"status": "queued",
"provider": "<string>",
"model": "<string>",
"output": {
"items": [
{
"type": "image",
"url": "<string>",
"mime_type": "<string>",
"size_bytes": 0,
"width": 0,
"height": 0,
"duration_seconds": 123,
"kind": "<string>",
"data": "<unknown>",
"expires_at": "<string>",
"field": "<string>",
"source": "provider",
"notice": "<string>",
"error": {
"code": "OUTPUT_UNAVAILABLE",
"message": "<string>"
}
}
],
"expired": true,
"dropped_count": 0
},
"usage": {
"units": [
{
"unit": "<string>",
"quantity": 123
}
]
},
"cost": {
"currency": "USD",
"state": "held",
"estimated": {
"amount": "<string>",
"amount_micros": 0
},
"charged": {
"amount": "<string>",
"amount_micros": 0
}
},
"charge_reason": "provider_billed_failure",
"timings": {
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
]
},
"metadata": {},
"idempotency_key": "<string>",
"app": {
"id": "<string>",
"url": "<string>",
"title": "<string>"
},
"sequence": 1,
"links": {
"self": "<string>"
}
}
],
"next_cursor": "<string>",
"has_more": true
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"request_id": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>",
"reason": "unknown_field",
"expected": "<string>",
"received": "<string>",
"allowed": [
"<string>"
]
}
],
"retry_after_seconds": 0
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Public status.
Available options:
queued, running, completed, failed, canceled Provider id.
Opaque; the next_cursor of the previous page.
1–list.max_limit (100), default list.default_limit (20).
Required range:
1 <= x <= 100