Loading...
Loading...
Compare original and translation side by side
Note: If you have the VM0 CLI installed and the vm0-cli skill available, prefer using the vm0-cli skill instead. It provides a higher-level interface with more convenient operations.
注意: 如果你已安装VM0 CLI且拥有vm0-cli技能,建议优先使用vm0-cli技能。它提供了更高级的接口和更便捷的操作。
export VM0_TOKEN=vm0_live_your-api-keyexport VM0_TOKEN=vm0_live_your-api-keyvm0 auth loginvm0 auth setup-tokenvm0_live_Important: When usingin a command that pipes to another command, wrap only the curl command in$VAR, then pipe to jq outside. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c '...'bashbash -c 'curl -s "https://api.vm0.ai/v1/agents" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data'
vm0 auth loginvm0 auth setup-tokenvm0_live_重要提示: 在使用包含的命令并通过管道符连接到其他命令时,请仅将curl命令包裹在$VAR中,然后在外部通过管道符连接到jq。由于Claude Code的bug,直接使用管道符时环境变量会被静默清除。bash -c '...'bashbash -c 'curl -s "https://api.vm0.ai/v1/agents" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data'
bash -c 'curl -s "https://api.vm0.ai/v1/agents" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data[] | {id, name}'bash -c 'curl -s "https://api.vm0.ai/v1/agents" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data[] | {id, name}'/tmp/vm0_request.json{
"agent": "my-agent",
"prompt": "Hello, please introduce yourself"
}bash -c 'curl -s -X POST "https://api.vm0.ai/v1/runs" -H "Authorization: Bearer $VM0_TOKEN" -H "Content-Type: application/json" -d @/tmp/vm0_request.json' | jq '{id, status}'/tmp/vm0_request.json{
"agent": "my-agent",
"prompt": "Hello, please introduce yourself"
}bash -c 'curl -s -X POST "https://api.vm0.ai/v1/runs" -H "Authorization: Bearer $VM0_TOKEN" -H "Content-Type: application/json" -d @/tmp/vm0_request.json' | jq '{id, status}'<run-id>bash -c 'curl -s "https://api.vm0.ai/v1/runs/<run-id>" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{id, status, error, execution_time_ms}'<run-id>bash -c 'curl -s "https://api.vm0.ai/v1/runs/<run-id>" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{id, status, error, execution_time_ms}'bash -c 'curl -s "https://api.vm0.ai/v1/runs/<run-id>/logs" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data[]'bash -c 'curl -s "https://api.vm0.ai/v1/runs/<run-id>/logs" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data[]'bash -c 'curl -s "https://api.vm0.ai/v1/agents" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data'bash -c 'curl -s "https://api.vm0.ai/v1/agents/<agent-id>" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{id, name, description}'bash -c 'curl -s "https://api.vm0.ai/v1/agents" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data'bash -c 'curl -s "https://api.vm0.ai/v1/agents/<agent-id>" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{id, name, description}'curl -s -X POST "https://api.vm0.ai/v1/runs" \
-H "Authorization: Bearer $VM0_TOKEN" \
-H "Content-Type: application/json" \
-d @- << 'EOF'
{
"agent": "my-agent",
"prompt": "Process the data file",
"variables": {
"DEBUG": "true"
},
"volumes": {
"input-data": "latest"
}
}
EOFbash -c 'curl -s -X POST "https://api.vm0.ai/v1/runs/<run-id>/cancel" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{id, status}'curl -s -X POST "https://api.vm0.ai/v1/runs" \
-H "Authorization: Bearer $VM0_TOKEN" \
-H "Content-Type: application/json" \
-d @- << 'EOF'
{
"agent": "my-agent",
"prompt": "Process the data file",
"variables": {
"DEBUG": "true"
},
"volumes": {
"input-data": "latest"
}
}
EOFbash -c 'curl -s -X POST "https://api.vm0.ai/v1/runs/<run-id>/cancel" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{id, status}'bash -c 'curl -s "https://api.vm0.ai/v1/volumes" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data[] | {id, name}'curl -L -o volume.tar.gz "https://api.vm0.ai/v1/volumes/<volume-id>/download" \
-H "Authorization: Bearer $VM0_TOKEN"bash -c 'curl -s "https://api.vm0.ai/v1/volumes" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data[] | {id, name}'curl -L -o volume.tar.gz "https://api.vm0.ai/v1/volumes/<volume-id>/download" \
-H "Authorization: Bearer $VM0_TOKEN"bash -c 'curl -s "https://api.vm0.ai/v1/artifacts" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data[] | {id, name}'curl -L -o artifact.tar.gz "https://api.vm0.ai/v1/artifacts/<artifact-id>/download" \
-H "Authorization: Bearer $VM0_TOKEN"tar -xzf artifact.tar.gz -C ./output/bash -c 'curl -s "https://api.vm0.ai/v1/artifacts" -H "Authorization: Bearer $VM0_TOKEN"' | jq '.data[] | {id, name}'curl -L -o artifact.tar.gz "https://api.vm0.ai/v1/artifacts/<artifact-id>/download" \
-H "Authorization: Bearer $VM0_TOKEN"tar -xzf artifact.tar.gz -C ./output/bash -c 'curl -s "https://api.vm0.ai/v1/runs?limit=10" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{data, pagination}'{
"pagination": {
"has_more": true,
"next_cursor": "abc123"
}
}bash -c 'curl -s "https://api.vm0.ai/v1/runs?limit=10&cursor=abc123" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{data, pagination}'bash -c 'curl -s "https://api.vm0.ai/v1/runs?limit=10" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{data, pagination}'{
"pagination": {
"has_more": true,
"next_cursor": "abc123"
}
}bash -c 'curl -s "https://api.vm0.ai/v1/runs?limit=10&cursor=abc123" -H "Authorization: Bearer $VM0_TOKEN"' | jq '{data, pagination}'{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "No such agent: 'my-agent'",
"param": "agent"
}
}| Error Type | Status | Description |
|---|---|---|
| 401 | Invalid or missing API key |
| 400 | Invalid parameters |
| 404 | Resource doesn't exist |
| 500 | Internal server error |
{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "No such agent: 'my-agent'",
"param": "agent"
}
}| 错误类型 | 状态码 | 描述 |
|---|---|---|
| 401 | API密钥无效或缺失 |
| 400 | 参数无效 |
| 404 | 资源不存在 |
| 500 | 服务器内部错误 |
https://api.vm0.ai/v1/https://api.vm0.ai/v1/