VM0VM0
ReferenceAPI Reference

API Overview

Introduction to the VM0 Public API v1

The VM0 Public API allows you to programmatically manage agents, execute runs, and work with storage resources.

Base URL

All API requests should be made to:

https://api.vm0.ai/v1/

Resources


Authentication

All API requests require authentication using a Bearer token in the Authorization header.

Token Format

API tokens follow this format:

vm0_live_<64 hex characters>

Using the Token

Include your token in the Authorization header with the Bearer prefix:

curl https://api.vm0.ai/v1/agents \
  -H "Authorization: Bearer vm0_live_xxx"

Obtaining a Token

Via CLI

The easiest way to get a token is through the VM0 CLI:

vm0 auth login

This creates a token and stores it in your local configuration. To view your token:

vm0 auth setup-token

Token Security

Keep your API tokens secure. Never commit them to version control or share them publicly.

Best practices:

  • Store tokens in environment variables
  • Use short expiration times for automated systems
  • Rotate tokens regularly
  • Revoke tokens immediately if compromised

Errors

The API uses standard HTTP status codes and returns structured error responses.

Error Response Format

{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "No such agent: 'my-agent'"
  }
}
FieldTypeDescription
typestringCategory of the error
codestringSpecific error code
messagestringHuman-readable error description

Error Types

TypeHTTP StatusDescription
authentication_error401Authentication failed
invalid_request_error400Invalid parameters or request body
not_found_error404Requested resource doesn't exist
conflict_error409Resource conflict (e.g., duplicate name)
api_error500Internal server error

Error Codes

Authentication Errors (401)

CodeDescription
invalid_api_keyAPI key is missing, malformed, expired, or revoked

Request Errors (400)

CodeDescription
invalid_parameterA parameter value is invalid
missing_parameterA required parameter is missing
invalid_stateResource is in an invalid state for the requested operation

Resource Errors (404, 409)

CodeDescription
resource_not_foundThe requested resource doesn't exist
resource_already_existsA resource with this name already exists

Pagination

List endpoints use cursor-based pagination to efficiently handle large result sets.

Response Format

Paginated responses include a pagination object:

{
  "data": [
    { "id": "ag_abc", "name": "agent-1" },
    { "id": "ag_def", "name": "agent-2" }
  ],
  "pagination": {
    "hasMore": true,
    "nextCursor": "eyJpZCI6ImFnX2RlZiJ9"
  }
}
FieldTypeDescription
hasMorebooleanWhether more results exist
nextCursorstringCursor for the next page (null if no more results)

Query Parameters

ParameterTypeDefaultDescription
limitinteger20Number of items per page (1-100)
cursorstring-Cursor from previous response

Usage

Request the first page without a cursor:

curl "https://api.vm0.ai/v1/agents?limit=10" \
  -H "Authorization: Bearer vm0_live_xxx"

Use the nextCursor from the previous response for subsequent pages:

curl "https://api.vm0.ai/v1/agents?limit=10&cursor=eyJpZCI6ImFnX2RlZiJ9" \
  -H "Authorization: Bearer vm0_live_xxx"

Response Headers

Every response includes these headers:

HeaderDescription
X-Request-IdUnique request identifier for debugging
X-API-VersionAPI version (currently v1)