When to use this runbook
Apply these rules to every autonomous Salad Container Engine, AI Gateway, and Transcription read, create, update, start, stop, scale, queue, job, instance, log, model-selection, completion, or IMDS workflow.When not to use it
Do not use these generic rules to infer an endpoint-specific request body or success state. Use the current OpenAPI operation where provided and the applicable task runbook for those details.Required inputs
- A caller-provided time budget and operational objective.
SALAD_API_KEYfor the public SaladCloud API; never print or persist its value.SALAD_AI_GATEWAY_API_KEYfor AI Gateway Bearer authentication; never print, persist, or substitute the regular API key.- Trusted resource scope and explicit user intent for destructive or capacity-reducing actions.
- A safe location for redacted pre-change or job evidence when recovery may be required.
Authoritative sources
- Using the API
- Agent Operations Overview
- Select a Model and Send an AI Gateway Request
- The current public API and IMDS OpenAPI specifications linked from the Container Engine API reference
Dynamic values to retrieve
Treat resource state, versions, instances, logs, events, queues, transcription jobs, endpoint metadata, AI Gateway model IDs, quotas, GPU classes, availability, prices, and capacity as dynamic. Retrieve them for the target scope immediately before they affect a decision and again after every mutation.Preflight checks
- Verify the target names or model selection and the authorization boundary.
- Classify the operation as a read, idempotent write, non-idempotent create, destructive action, or asynchronous lifecycle or billable model request.
- Before a resource change, read the resource and save a redacted record of fields that may change.
- Define the success condition, verification method, maximum attempts, elapsed-time budget, and stop condition.
- For Container Engine, check that local instance/job state is externalized before replacement. For Transcription, protect signed media URLs, metadata, webhooks, and output as sensitive data.
- For AI Gateway, protect prompts, conversation history, images, tool definitions and results, and model output. Treat a completion as billable and non-idempotent when the documentation does not guarantee otherwise.
Procedure
- Retrieve the applicable live resource, job, or model state and compare it with the requested outcome.
- Skip a write when the desired outcome is already true.
- Use the narrowest valid mutation or documented model request. For merge patches, send only intended changes while preserving current nested values that must remain.
- Record the response status and identifiers without credential-bearing headers or secret fields.
- Perform the specified verification. Use a fresh read and bounded polling for asynchronous operations; for AI Gateway, confirm the live model before the request and retain the exact response or stream afterward.
- Return the verified result or stop with the last observed state.
Decision rules
Expected states and responses
Creation may return201; lifecycle and deletion requests may return 202; merge-patch updates may return 200. These
status codes come from the current operation definitions. Runtime convergence must still be established through resource
and instance reads.
Container Group status values are pending, running, stopped, succeeded, failed, and deploying. Instance
state values are allocating, downloading, creating, running, and stopping. Transcription job states are
pending, running, succeeded, cancelled, and failed. Do not mix state enums across resource types.
AI Gateway returns an immediate completion response or stream rather than a durable job state. A partial stream or
transport failure is not proof that the request failed or was not billed.
Retry behavior
Use bounded exponential backoff with jitter as agent behavior, not as a SaladCloud API guarantee. The caller or task must set a maximum attempt count and elapsed-time budget. Respect a server-providedRetry-After value. Do not
prescribe undocumented exact delays, and do not reset the overall budget after each response.
Never blindly retry:
- Authentication or authorization failures.
- Schema validation, invalid enum, invalid configuration, or missing-field errors.
- A create request whose outcome is unknown, especially a job create with no returned server ID.
- An AI Gateway completion after a timeout,
5xx, interrupted response, or partial stream. - A destructive action, cancellation, or capacity reduction.
- Reallocation as a generic response to application or configuration failures.
Verification
Verification is a fresh read, not the mutation response. Compare observed configuration, version, state, counts, job events/output, and relevant instance fields with an explicit success predicate. For named creates, list/get the exact name. For queue or transcription jobs, read the returned job ID. Retain the last response and UTC observation time. For AI Gateway, verify the selected model with a fresh/v1/models response before sending one completion, then retain the
exact response or stream result. No documented completion-status read exists for reconciliation.
Rollback or recovery
- Restore only fields changed by the failed update, using the saved pre-change values and a fresh read.
- If a create succeeded but later deployment failed, keep the resource for diagnosis unless the user explicitly asks for deletion.
- If a write outcome is unknown, reconcile with a read before sending another write.
- If an instance is replaced, recover from external storage or a durable queue; local instance state is ephemeral.
- A transcription job cannot be updated. Cancellation or replacement requires explicit intent; retrieve a succeeded job by ID instead of repeating work after a webhook failure.
- AI Gateway token usage and generated output cannot be rolled back. A corrective request is new billable work.