Skip to content

Admit a run against an immutable version and funded grant

POST
/katara/v1/orgs/{org_id}/environments/{environment_id}/runs
curl --request POST \
--url https://api.katara.com/katara/v1/orgs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/environments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--header 'X-Katara-CSRF: 1' \
--data '"example"'

Available when the corresponding service is configured. Preserve the same idempotency key after an uncertain response. The returned operation resource_id identifies the committed version or run; run acceptance does not mean execution succeeded.

org_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
environment_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
Idempotency-Key
required
string
/^[A-Za-z0-9._:-]{8,128}$/
X-Katara-CSRF
Allowed value: 1

Browser cookie mutations require value 1 and an allowed Origin. Session bearer clients may omit this header.

X-Katara-Account-ID
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/

Required for cookie-authenticated changes. Use the UUID of the account that loaded the application. A different current cookie account returns account_changed before the handler runs. Session bearer and API key clients do not require this header.

PAYMENT-SIGNATURE
string
<= 22000 characters

Base64 of a signed x402 payment answering this request’s challenge. Only for a run on a budget paid per run with x402, started with an API key that an owner allowed to pay with x402. One payment starts one run; sending it again returns the same run.

Media typeapplication/json

Model, tools, schemas and limits come from the immutable agent version. Paid Test Compute requires the exact consent funding the grant budget; the API checks it against current payer authority.

object
agent_version
required
object
id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
version
required
integer
>= 1 <= 9007199254740991
integrity
required
string
/^sha256:[a-f0-9]{64}$/
grant_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
input_ref
required
object
org_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
environment_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
version
required
integer
>= 1 <= 9007199254740991
integrity
required
string
/^sha256:[a-f0-9]{64}$/
media_type
required
Allowed value: application/json
size_bytes
required
integer
<= 1048576
budget_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
usage_class
required
Allowed values: simulation test_compute live
paid_test_consent_id
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
output_target
required

Explicit destination for run artifacts. Store and key versions must still be active at admission and byte access. Choose retention from 60 seconds to 365 days; no silent default or destination substitution.

object
store_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
store_version
required
integer
>= 1 <= 9007199254740991
key_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
key_version
required
integer
>= 1 <= 9007199254740991
retention_seconds
required
integer
>= 60 <= 31536000
workload_grants
required
Array<object>
>= 1 items <= 8 items unique items
object
id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
audience
required
Allowed values: katara:synapse katara:locus

Successful request

Media typeapplication/json
object
operation_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
resource_id
required
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
completed
required
boolean
Examplegenerated
{
"operation_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"resource_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"completed": true
}

X402_payment_required: the run’s budget is paid per run with x402 and the request carried no payment. The body, and base64 in the PAYMENT-REQUIRED header, is the run’s challenge: one entry per scheme, upto first, each for the run’s maximum. Sign one and send the same request again with the payment in the PAYMENT-SIGNATURE header. payment_invalid: the payment did not verify, has expired or answers another request’s challenge. x402_insufficient_funds: the wallet does not cover this run with the other runs it is paying for.

Media typeapplication/json

An x402 version 2 challenge for one run: one entry per scheme, upto first, each for the run’s maximum.

object
x402Version
required
Allowed value: 2
error
required
string
<= 200 characters
resource
required
object
url
required
string
<= 2000 characters
description
required
string
<= 500 characters
mimeType
required
Allowed value: application/json
accepts
required
Array<object>
>= 1 items <= 4 items
object
scheme
required
Allowed values: upto exact
network
required
string
/^eip155:[0-9]+$/
asset
required
string
/^0x[0-9a-fA-F]{40}$/
amount
required
string
/^[1-9][0-9]{0,15}$/
payTo
required
string
/^0x[0-9a-fA-F]{40}$/
maxTimeoutSeconds
required
integer
>= 60 <= 86400
extra

Scheme details and the binding of this challenge to its run request, signed back with the payment.

object
extensions
object
eip2612GasSponsoring
object
Example
{
"x402Version": 2,
"resource": {
"mimeType": "application/json"
},
"accepts": [
{
"scheme": "upto"
}
]
}
PAYMENT-REQUIRED
string

Base64 of the x402 challenge, as in the body.

X402_key_required: a run paid with x402 is started with an API key. x402_not_enabled: x402 payment is off for the key, or the paying wallet is not one it lists.

Account_changed: reload and review with the signed-in account; wallet_insufficient_funds, wallet_payment_failed, wallet_unpaid_limit: a run on a wallet budget was refused because of its wallet. x402_budget_in_use: another paid run holds the x402 budget. x402_payment_required: the budget is paid per run and cannot be used without a payment.

X402_wallet_run_limit: the wallet is already paying for as many runs as it may at once.

Request error

Media typeapplication/json
object
error
required
object
message
required
string
>= 1 characters <= 500 characters
type
required
string
>= 1 characters <= 100 characters
code
required

Stable; branch on it. Any operation can answer invalid_request, with param naming the refused field when there is one; human_session_required, when an API key, service account or workload calls an operation only a signed-in person may perform; reauthentication_required, when a person’s sign-in is too old for the operation; permission_denied; route_not_found and method_not_allowed, when no operation matches the path or method; and feature_unavailable, when the operation’s service is not enabled on this deployment.

string
>= 1 characters <= 100 characters
param
required

The request field a refusal is about, such as the agent_id or run_id query parameter; null when the refusal is not about one field.

string | null
request_id
required
string
>= 1 characters <= 100 characters
upstream_status
required
integer | null
action
Allowed values: sign_in reauthenticate request_access review fund retry reconcile refresh support
operation_id
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
snapshot_ref
string format: uuid
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/
Allowed value: 00000000-0000-0000-0000-000000000000
Example
{
"error": {
"action": "sign_in"
}
}