Skip to main content
POST
/
agents
Create agent
curl --request POST \
  --url https://api.blaxel.ai/v0/agents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metadata": {
    "name": "my-resource",
    "displayName": "My Resource",
    "labels": {}
  },
  "spec": {
    "enabled": true,
    "policies": [
      "<string>"
    ],
    "public": false,
    "region": "us-pdx-1",
    "repository": {
      "type": "github",
      "url": "https://github.com/my-org/my-agent"
    },
    "revision": {
      "active": "rev-abc123",
      "canary": "<string>",
      "canaryPercent": 10,
      "stickySessionTtl": 0,
      "traffic": 100
    },
    "runtime": {
      "envs": [
        {
          "name": "MY_ENV_VAR",
          "secret": true,
          "value": "my-value"
        }
      ],
      "generation": "mk3",
      "image": "<string>",
      "maxScale": 10,
      "memory": 2048,
      "minScale": 0
    },
    "triggers": [
      {
        "configuration": {
          "authenticationType": "blaxel",
          "callbackUrl": "https://myapp.com/webhook",
          "path": "/invoke",
          "retry": 3,
          "schedule": "0 * * * *",
          "tasks": [
            {}
          ],
          "timeout": 300
        },
        "enabled": true,
        "id": "trigger-1",
        "type": "http"
      }
    ],
    "volumes": [
      {
        "mountPath": "/mnt/data",
        "name": "my-volume",
        "readOnly": false
      }
    ]
  }
}
'
{
  "metadata": {
    "name": "my-resource",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "createdBy": "<string>",
    "updatedBy": "<string>",
    "displayName": "My Resource",
    "labels": {},
    "plan": "<string>",
    "url": "<string>",
    "workspace": "<string>"
  },
  "spec": {
    "enabled": true,
    "policies": [
      "<string>"
    ],
    "public": false,
    "region": "us-pdx-1",
    "repository": {
      "type": "github",
      "url": "https://github.com/my-org/my-agent"
    },
    "revision": {
      "active": "rev-abc123",
      "canary": "<string>",
      "canaryPercent": 10,
      "stickySessionTtl": 0,
      "traffic": 100
    },
    "runtime": {
      "envs": [
        {
          "name": "MY_ENV_VAR",
          "secret": true,
          "value": "my-value"
        }
      ],
      "generation": "mk3",
      "image": "<string>",
      "maxScale": 10,
      "memory": 2048,
      "minScale": 0
    },
    "triggers": [
      {
        "configuration": {
          "authenticationType": "blaxel",
          "callbackSecret": "<string>",
          "callbackUrl": "https://myapp.com/webhook",
          "path": "/invoke",
          "retry": 3,
          "schedule": "0 * * * *",
          "tasks": [
            {}
          ],
          "timeout": 300
        },
        "enabled": true,
        "id": "trigger-1",
        "type": "http"
      }
    ],
    "volumes": [
      {
        "mountPath": "/mnt/data",
        "name": "my-volume",
        "readOnly": false
      }
    ]
  },
  "events": [
    {
      "canaryRevision": "<string>",
      "message": "Deployment successful",
      "revision": "rev-abc123",
      "status": "DEPLOYED",
      "time": "2025-01-15T10:30:00Z",
      "type": "deployment"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.blaxel.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

OAuth2 authentication with JWT tokens

Body

application/json

Serverless AI agent deployment that runs your custom agent code as an auto-scaling API endpoint. Agents are deployed from your code repository and expose a global inference URL for querying.

metadata
object
required

Common metadata fields shared by all Blaxel resources including name, labels, timestamps, and ownership information

spec
object
required

Configuration for an AI agent including runtime settings, repository source, and deployment triggers

Response

successful operation

Serverless AI agent deployment that runs your custom agent code as an auto-scaling API endpoint. Agents are deployed from your code repository and expose a global inference URL for querying.

metadata
object
required

Common metadata fields shared by all Blaxel resources including name, labels, timestamps, and ownership information

spec
object
required

Configuration for an AI agent including runtime settings, repository source, and deployment triggers

events
object[]
read-only

Events happening on a resource deployed on Blaxel

status
enum<string>
read-only

Deployment status of a resource deployed on Blaxel

Available options:
DELETING,
TERMINATED,
FAILED,
DEACTIVATED,
DEACTIVATING,
UPLOADING,
BUILDING,
DEPLOYING,
DEPLOYED,
BUILT
Last modified on May 27, 2026