Create Deployment
Call Create agent first and replace the example agent ID with its returned ID. Call Create environment first and replace env_123 with its returned ID.
/agent/v1/deployments● SupportedRequest body
namestringrequiredHuman-readable name for the deployment.
agentstring | objectrequiredThe agent to run: an agent ID string, or an object {type, id, version?} (see subfields); the operation description says how the version is chosen and which overrides apply.
Expand sub-fields (6)
idstringrequiredThe ID of the agent the session runs.
typestringrequiredReference type: agent, or agent_with_overrides when the reference carries inline overrides.
versionnumberoptionalThe specific agent version to pin; omit for active_version at session creation, which need not be the newest saved version.
permission_modestringoptionalPermission mode for each new session; omitted or null inherits the agent policies. Not used when type is agent.
cwdstringoptionalWorking directory for each new session; omitted uses the session default. Not used when type is agent.
modelstring | objectoptionalReplacement model for this session: a model name string (e.g. claude-opus-5) or a config object; omit to keep the agent's model.
environment_idstringoptionalID of the
environmentdefining the container configuration for sessions created from this deployment.metadataobjectoptionalArbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
initial_eventsarrayrequiredEvents to send to each session immediately after creation. At least 1, maximum 50.
budgetobjectoptionalA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches
max_list_cost.Expand sub-fields (2)
max_list_costobjectrequiredLargest list-price cost the session may reach: {amount, currency: "USD"} where amount is in US dollars, an integer or up to 2 decimals on input ("0.50") and exactly 2 decimals on output ("20.00").
typestringrequiredBudget kind; always limit. Any other value, including max_list_cost, returns 400.
descriptionstringoptionalDescription of what the deployment does.
resourcesarrayoptionalResources (e.g. repositories, files) to mount into each session's container. Maximum 500.
scheduleobjectoptional5-field POSIX cron schedule. Literal wall-clock matching in the configured timezone.
Expand sub-fields (3)
expressionstringrequired5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).
timezonestringrequiredRequired. IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). Validated against the IANA timezone database.
typestringrequiredCron schedule selector: five POSIX fields matched in the required IANA timezone.
vault_idsarrayoptionalVault IDs for stored credentials the agent can use during sessions created from this deployment. Maximum 50.
More parameters (1)
targetobjectoptionalExecution target. environment (default) requires an existing, unarchived environment_id. computer is available only for personal agents and permits environment_id to be omitted.
Expand sub-fields (1)
typestringrequiredenvironment uses an environment recipe; computer uses the agent computer.
Returns
200
Deployment resources support creation, retrieval, filtering, updates, archival, pause and unpause. Versions are pinned; schedules return up to five future occurrences. Only user.message initial events and file resources are accepted; vault_ids is accepted up to 50 deduplicated ids, each owned by the organization and not archived, and a missing or archived vault returns 400 vault_ids[<index>] <id> was not found. Manual triggers and cron schedules create sessions that carry the deployment's vault_ids; creation failures record an error run and automatically pause the deployment, and a vault archived after the deployment was saved is recorded as vault_archived_error. Own extensions accept agent_with_overrides and target=computer for general agents only. Overrides support model, permission_mode and cwd; tools, mcp_servers, system and skills return 400.
Errors follow the Anthropic error format (type / message / request_id) — see error codes
Request
curl
# Call Create agent first and replace the example agent ID with its returned ID. Call Create environment first and replace env_123 with its returned ID.
curl https://api.deepraxis.com/agent/v1/deployments \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent":"agent_123","environment_id":"env_123","name":"文档测试","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Hi"}]}]}'Python
# Call Create agent first and replace the example agent ID with its returned ID. Call Create environment first and replace env_123 with its returned ID.
import requests
opts = dict(
base_url="https://api.deepraxis.com/agent",
api_key="$PRAXIS_API_KEY",
)
# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.post(
f"{opts['base_url']}/v1/deployments",
headers={"Authorization": f"Bearer {opts['api_key']}"},
json={"agent":"agent_123","environment_id":"env_123","name":"文档测试","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Hi"}]}]},
)
print(resp.status_code, resp.json())TypeScript
// Call Create agent first and replace the example agent ID with its returned ID. Call Create environment first and replace env_123 with its returned ID.
const opts = {
baseURL: "https://api.deepraxis.com/agent",
apiKey: "$PRAXIS_API_KEY",
};
// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/deployments`, {
method: "POST",
headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({"agent":"agent_123","environment_id":"env_123","name":"文档测试","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Hi"}]}]}),
});
console.log(resp.status, await resp.json());Response 200
{
"agent": {
"type": "agent",
"id": "agent_09008842-6eae-4989-bbc5-aa6198b0d3f2",
"version": 1
},
"target": {
"type": "environment"
},
"environment_id": "env_3be6389448d74640917cb2b40965d1dd",
"name": "文档测试",
"description": null,
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "Hi"
}
]
}
],
"resources": [],
"vault_ids": [],
"budget": null,
"schedule": null,
"metadata": {},
"id": "depl_31225cd719414818b84ef203c9cec2c8",
"type": "deployment",
"status": "active",
"paused_reason": null,
"created_at": "2026-10-22T15:23:10.382Z",
"updated_at": "2026-10-22T15:23:10.382Z",
"archived_at": null
}Response
HTTP 200
Successful response
application/json
| Name | Type | Description |
|---|---|---|
| id | string | Unique identifier for this deployment. |
| agent | object | Agent reference. Naming a version pins the deployment to it; naming only an id (or a bare id string) makes it follow the agent's active version, so every run uses whichever version is in effect then and a later agent save carries through automatically. The response also carries pinned_version (null while following) and active_version (the agent's currently effective version). The own face also accepts model, permission_mode and cwd overrides for new sessions. |
| agent.id | string | Agent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls. / The agent ID. |
| agent.type | string | Always agent. An agent definition. / An agent reference with model, permission_mode and cwd overrides for new sessions. |
| agent.version | number | The latest saved version of the agent, the editable head; it differs from active_version after a save with apply false. Starts at 1 and increments each time the agent is modified. / The agent version this deployment uses now; while the deployment follows the agent this is the active version, otherwise the version it is pinned to. |
| agent.pinned_version | integer | null | The version this deployment is pinned to; null when it follows the agent's active version. |
| agent.active_version | integer | null | The agent's currently effective version, the one a run would use now; null when the agent cannot be read. |
| agent.permission_mode | string | null | Permission mode for each new session; omitted or null inherits the agent policies. |
| agent.cwd | string | Working directory for each new session; omitted uses the session default. |
| agent.model | string | object | Replacement model id or model_config. Validated and stored without executing a session. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Description of what the deployment does. |
| environment_id | string | null | Existing, unarchived environment id; environment_id and target are alternatives, so send at least one. target=environment requires it, target=computer (own face, general agents) may omit it; null is also accepted there. |
| initial_events | array<object> | Events sent to each session immediately after creation. |
| initial_events[].content | array<object> | Array of content blocks for the user message. / System content blocks to append. Text-only. |
| initial_events[].type | string | Always user.message. A message from the user to the agent, with content blocks. / Always user.define_outcome. The user defined the outcome the agent should reach. / Always system.message. A message produced by the platform rather than the user or the agent. |
| initial_events[].description | string | What the agent should produce. This is the task specification. |
| initial_events[].rubric | object | Rubric for grading the quality of an outcome. |
| initial_events[].max_iterations | null | number | Eval→revision cycles before giving up. Default 3, max 20. |
| metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| name | string | Human-readable name. |
| paused_reason | null | object | Why a deployment is paused. Non-null exactly when status is paused. |
| paused_reason.type | string | Always manual. An explicit request triggered this run or paused this deployment. / Always error. A stream error. |
| paused_reason.error | object | The error that triggered an auto-pause. Matches the failed run's error.type. |
| resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| resources[].type | string | Always github_repository. A GitHub repository resource; not supported on this platform. / Always file. A file resource: an uploaded file mounted into the session's machine. / Always memory_store. A memory store resource; not supported on this platform. |
| resources[].url | string | Github URL of the repository |
| resources[].checkout | null | object | Branch or commit to check out. Defaults to the repository's default branch. |
| resources[].mount_path | null | string | Mount path in the container. Defaults to /workspace/<repo-name>. / Mount path in the container. Defaults to /mnt/session/uploads/<file_id>. |
| resources[].file_id | string | ID of a previously uploaded file. |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| schedule.expression | string | 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily). |
| schedule.timezone | string | IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). |
| schedule.type | string | Always cron. A five-field POSIX schedule matched in its IANA timezone. |
| schedule.last_run_at | null | string | A timestamp in RFC 3339 format |
| schedule.upcoming_runs_at | array<string> | Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (archived_at set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time. |
| status | string | Lifecycle status of a deployment. |
| type | string | Always deployment. A frozen set of session parameters and an optional schedule. |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches max_list_cost. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string | Budget kind; always limit. Any other value, including max_list_cost, returns 400 budget.type must be "limit". |
| target | object | Execution target. environment (default) requires an existing, unarchived environment_id. computer is available only for general agents and permits environment_id to be omitted. |
| target.type | string | environment uses an environment recipe; computer uses the agent computer. |
Before running the example
Create an agent and an environment first; replace agent_123 and env_123 with their IDs. This example has no schedule: call Run deployment to create a session. Archive the deployment, environment and agent after testing.