Codex InfinityCodexInfinity

Developer Documentation

CLI + REST API for agents and tasks

Contents

CLI Usage

Installation

curl -fsSL https://codexinfinitystatic.codex-infinity.com/cli/latest/install.sh | bash

Browse Cloud Tasks

Open the interactive TUI to browse and manage your cloud tasks:

codex cloud

Submit a Cloud Task

codex cloud exec --env myapp --attempts 2 "fix the login bug"
FlagDescription
--envTarget environment/project identifier
--attemptsNumber of parallel attempts (1-4, default: 1)

Authentication

All API requests require a Bearer token. Get your API key from the Account Settings.

Authorization: Bearer YOUR_API_KEY

Public add-on APIs (Auth/Realtime) use a Supabase-style apikey header (per project) plus JWTs for end users.

Infinity Git (SSH) uses your ssh_authorized_keys from PUT /api/settings to map SSH public keys to your user.

Tasks API

GET/api/tasks

List all tasks for the authenticated user.

curl -H "Authorization: Bearer $API_KEY" \
  https://codex-infinity.com/api/tasks

POST/api/tasks

Create a new task.

curl -X POST \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Add user authentication",
    "repo": "owner/repo",
    "branch": "main",
    "agent_type": "claude-code"
  }' \
  https://codex-infinity.com/api/tasks
FieldTypeDescription
titlestringTask description/prompt
repostringGitHub repository (owner/repo)
branchstringTarget branch
agent_typestring"claude-code" or "codex"

GET/api/tasks/:id

Get task details including status and output.

POST/api/tasks/:id/cancel

Cancel a running task.

GitHub Integration

Install the Codex Infinite GitHub App to enable PR comment triggers and automation. For private repos, install the app or add @codeggsinfinity as a collaborator/team member. Commenters must link their GitHub account in Codex for tasks to be created.

Legacy mentions also work: @codex-infinite, @codexinfinite, @codex.

@codeggsinfinity review this PR
/codex fix failing tests

The bot replies with a task link like https://codex-infinity.com/task/<task_id> and runs on the PR’s head branch.

Infinity Git (SSH Remote)

Infinity Git is a built-in SSH-only git remote service. Repos are bare repos hosted on the control-plane filesystem and controlled by Codex Infinity users, orgs/teams, and roles.

Set a handle (your namespace)

curl -X POST \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "handle": "alice" }' \
  https://codex-infinity.com/api/account/handle

Add SSH public keys

curl -X PUT \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ssh_authorized_keys": ["ssh-ed25519 AAAA... you@laptop"] }' \
  https://codex-infinity.com/api/settings

Create a repo

# In your namespace (alice/demo)
curl -X POST \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "demo" }' \
  https://codex-infinity.com/api/git/repos

Org/team namespaces

# Create an org/team
curl -X POST \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "handle": "acme", "display_name": "Acme Inc" }' \
  https://codex-infinity.com/api/git/orgs

# Add a member (read/write/owner)
curl -X POST \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "role": "write" }' \
  https://codex-infinity.com/api/git/orgs/acme/members

SSH remote usage

Infinity Git SSH runs on port 2222 by default. The easiest way to use it is with an SSH host alias:

# ~/.ssh/config
Host infinity
  HostName codex-infinity.com
  User git
  Port 2222
  IdentitiesOnly yes
git clone infinity:alice/demo.git
git remote add infinity infinity:alice/demo.git
git push infinity main

Management API

MethodEndpointDescription
GET/api/git/reposList repos you can access
POST/api/git/reposCreate repo
GET/api/git/repos/:namespace/:nameGet repo + your role
DELETE/api/git/repos/:namespace/:name?confirm=trueDelete repo (owner only)
GET/api/git/repos/:namespace/:name/membersList explicit members
POST/api/git/repos/:namespace/:name/membersAdd/update member (owner only)
DELETE/api/git/repos/:namespace/:name/members/:user_idRemove member (owner only)
GET/api/git/orgsList orgs/teams
POST/api/git/orgsCreate org/team
GET/api/git/orgs/:handleGet org + your role
GET/api/git/orgs/:handle/reposList repos in org/team
GET/api/git/orgs/:handle/membersList org/team members
POST/api/git/orgs/:handle/membersAdd/update org member (owner only)
DELETE/api/git/orgs/:handle/members/:user_idRemove org member (owner only)

Agents API

GET/api/agents

List active agent instances.

POST/api/agents

Launch a new agent instance.

curl -X POST \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-agent",
    "server_type": "cx22",
    "location": "nbg1",
    "repo_url": "https://github.com/owner/repo"
  }' \
  https://codex-infinity.com/api/agents

DELETE/api/agents/:id

Terminate an agent instance.

Add-ons

Add-ons are project-scoped managed services (Postgres, Mongo, Memcache, Auth). They are configured via the project API.

GET/api/projects/:repo/addons

List add-ons for a project.

curl -H "Authorization: Bearer $API_KEY" \
  https://codex-infinity.com/api/projects/owner%2Frepo/addons

POST/api/projects/:repo/addons

Enable/provision an add-on for a project.

curl -X POST \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "type": "auth" }' \
  https://codex-infinity.com/api/projects/owner%2Frepo/addons

Auth Add-on

The auth add-on is a Supabase-style Auth service implemented in Go. Provision it via the Add-ons API, then use the public Auth endpoints from your app.

Requests require apikey (use the add-on's anon_key or service_key).

POST/api/auth/v1/signup

curl -X POST \
  -H "apikey: $ANON_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "password": "password123" }' \
  https://codex-infinity.com/api/auth/v1/signup

POST/api/auth/v1/token?grant_type=password

curl -X POST \
  -H "apikey: $ANON_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "password": "password123" }' \
  https://codex-infinity.com/api/auth/v1/token?grant_type=password

GET/api/auth/v1/user

curl -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  https://codex-infinity.com/api/auth/v1/user

Realtime

Realtime is a project-scoped websocket pub/sub service keyed by your Auth add-on apikey. Optionally pass an Auth JWT as token for end-user identity.

// Browser example
const url = `wss://codex-infinity.com/api/realtime/v1/websocket?apikey=${encodeURIComponent(ANON_KEY)}&token=${encodeURIComponent(ACCESS_TOKEN)}`
const ws = new WebSocket(url)

ws.onmessage = (e) => console.log('msg', JSON.parse(e.data))
ws.onopen = () => {
  ws.send(JSON.stringify({ type: 'subscribe', channel: 'chat' }))
  ws.send(JSON.stringify({ type: 'broadcast', channel: 'chat', event: 'message', payload: { text: 'hello' } }))
}

CI Sentinel

AI-assisted CI runs with auto-fix tasks.

POST/api/ci-sentinels

curl -X POST \\
  -H "Authorization: Bearer $API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
    "name": "bullet-ci",
    "repo": "lee101/bullet",
    "runner_label": "codex-infinity",
    "pool_min": 0,
    "pool_max": 4,
    "auto_fix_enabled": true
  }' \\
  https://codex-infinity.com/api/ci-sentinels

GET/api/ci-sentinels/:id/runner-token

Create a GitHub Actions runner registration token for the sentinel repo or org.

POST/api/ci-sentinels/:id/runners

curl -X POST \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "count": 1,
    "server_type": "cx22",
    "location": "fsn1",
    "labels": ["bullet-ci"]
  }' \
  https://codex-infinity.com/api/ci-sentinels/ci_123/runners

POST/api/ci-sentinels/:id/events

curl -X POST \\
  -H "Authorization: Bearer $API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
    "external_id": "123-1",
    "repo": "lee101/bullet",
    "branch": "main",
    "commit_sha": "abc123",
    "workflow": "CI",
    "job_name": "test",
    "status": "completed",
    "conclusion": "success"
  }' \\
  https://codex-infinity.com/api/ci-sentinels/ci_123/events

Webhooks

Configure webhooks in your Project Settings to receive notifications when:

Back to Home