Create a Cloud Agent
const url = 'https://api.runta.com/v2/agents';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","system_prompt":"example","initial_message":"example","repositories":[{"repository_id":1,"branch":"example"}],"model_provider":{"type":"managed","id":"example"},"runtime":{"type":"fresh","image_id":"example","checkpoint_id":"example","id":"example"},"harness":{"id":"example","kind":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.runta.com/v2/agents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "system_prompt": "example", "initial_message": "example", "repositories": [ { "repository_id": 1, "branch": "example" } ], "model_provider": { "type": "managed", "id": "example" }, "runtime": { "type": "fresh", "image_id": "example", "checkpoint_id": "example", "id": "example" }, "harness": { "id": "example", "kind": "example" } }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Ordered GitHub repositories to initialize for fresh or checkpoint runtimes. The first is the default workspace. Nonempty selections are not allowed for existing runtimes.
object
object
object
object
Responses
Section titled “Responses”Cloud Agent created.
object
object
Examplegenerated
{ "id": "example", "runtime_id": "example", "harness_id": "example", "name": "example", "status": "example", "created_at_unix_seconds": 1, "updated_at_unix_seconds": 1, "latest_reply": { "run_id": "example", "text": "example", "created_at": "example", "updated_at": "example" }}Missing, malformed, or rejected bearer token
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}The bearer token is not allowed to perform this action
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}The requested resource was not found
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}The request conflicts with current resource state
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Validation or application error
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Rate limit exceeded
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Operation is not implemented
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Upstream service is unavailable
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Upstream request timed out
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}default
Section titled “default”Error response
object
object
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}