Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/21st-dev/1code/llms.txt

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

The 1Code REST API enables you to run coding agents programmatically. Point the API at a repository, provide a task, and the agent runs in an isolated cloud sandbox and delivers a pull request.

Key Features

  • Remote Sandboxes - Isolated cloud environment with repo cloned and dependencies installed
  • Git & PR Integration - Agent commits, pushes branches, and opens PRs automatically
  • Async Execution - Fire and forget, poll for status or get notified via webhooks
  • Follow-up Messages - Send additional instructions to a running task

Base URL

https://1code.dev/api/v1

Authentication

All API requests require authentication using an API key. See Authentication for details.

Quick Example

curl -X POST https://1code.dev/api/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "repository": "https://github.com/your-org/your-repo",
    "prompt": "Fix the failing CI tests"
  }'

Response Format

All API responses are in JSON format. Successful responses return a 2xx status code, while errors return 4xx or 5xx codes with an error message.
{
  "id": "task_abc123",
  "status": "running",
  "repository": "https://github.com/your-org/your-repo",
  "prompt": "Fix the failing CI tests",
  "created_at": "2026-03-04T10:00:00Z"
}

Rate Limits

API requests are rate limited based on your subscription tier:
  • Free: 10 requests per hour
  • Pro: 100 requests per hour
  • Max: 1000 requests per hour

Next Steps

Authentication

Learn how to authenticate your API requests

Tasks

Create and manage agent tasks

Webhooks

Get notified when tasks complete

Build docs developers (and LLMs) love