Agent resources

CLI Workflows

Combine Orchestor CLI commands to complete tasks such as selecting a workspace or retrieving a generated video. Each workflow shows what to pass to the next command, what to check in the output, and where to resume if a step fails.

WorkflowDescriptionEntry point
Sign in and select a workspaceAuthorize the CLI in your browser and confirm the selected workspace.Authentication
Generate an image and retrieve the resultInspect a model and wait for an image job to finish.Image
Generate a video from an imageSupply an image as the start frame and wait for the video job to finish.Video
Check credit balances and usageCheck credit balances, prepaid USD balance, and usage within a time range.Billing
Set up skills and MCP for CodexInstall project skills and connect Codex to Orchestor MCP.Setup

Sign in and select a workspace

Authorize the CLI in your browser, then select a workspace for future commands. Use whoami to confirm the account and workspace the CLI uses.

Quick reference

terminal
# 1. Sign in with an existing account. For a new account, use orc signup
orc auth login --web
# 2. List the workspaces you can access
orc workspace list --json
# 3. Replace WORKSPACE_ID with the ID you selected from the list
orc workspace use WORKSPACE_ID
# 4. Verify the account and workspace
orc whoami --json

1. Authorize the CLI in your browser

terminal
orc auth login --web

If you need to create an account, run this command instead.

terminal
orc signup

For a new account, verify your email in the browser. Check that the confirmation codes in the browser and terminal match before authorizing the CLI. If the CLI saves your credentials and reports that initial setup is required, complete the displayed steps before listing workspaces. If the command exits with code 2 and shows Authentication expired. or Authorization denied by user., run it again to restart authorization. Authentication · Sign up

2. Find the workspace ID

terminal
orc workspace list --json

When success is true, select the workspace id from the list in data. If error.category is auth, check which account you authorized and whether it has workspace access. Workspace · Authentication

3. Save the default workspace

terminal
orc workspace use WORKSPACE_ID

Replace WORKSPACE_ID with the ID from the previous step. The command displays it as defaultWorkspace. If you see Missing Workspace id., supply the ID and run the command again. Workspace

4. Verify the selection

terminal
orc whoami --json
Output (IDs replaced, some fields omitted)
{
  "success": true,
  "data": {
    "authenticated": true,
    "auth": {
      "valid": true,
      "auth_method": "api_key",
      "workspace_id": "wks_AUTHENTICATED",
      "role": "machine",
      "rate_limit": { "limit": 200, "remaining": null, "reset": null }
    },
    "workspace": {
      "id": "CONFIGURED_WORKSPACE_ID",
      "source": "global",
      "configured_id": "CONFIGURED_WORKSPACE_ID",
      "authenticated_id": "wks_AUTHENTICATED",
      "name": null,
      "matches": false
    }
  },
  "metadata": { "namespace": "whoami", "command": "", "duration": 1102 }
}

In this example the CLI is authenticated with an API key and the saved default workspace differs from the authenticated one, so matches is false.

Check data.user and data.workspace.id. If the ID differs from the one you selected, inspect data.workspace.source. The ORCHESTOR_WORKSPACE_ID environment variable and .orchestor/workspace.json in the current directory take precedence over the saved default. Use --workspace to select a workspace for one command.

If data.workspace.matches is false, the CLI selection differs from the workspace in your credentials. Check the account and selection settings before proceeding. If you see Authentication is invalid., check the active credentials. Account and workspace · Global options

Generate an image and retrieve the result

Inspect the inputs supported by an image model in the selected workspace. Submit a prompt and wait for the job to return the image URL.

Quick reference

terminal
# 1. Inspect the image model
orc image models get gpt-image-2 --json
# 2. Generate the image and wait for the result
orc image generate --model gpt-image-2 --prompt "A red cube on a white background" --wait --timeout 5m --json
# 3. If the wait times out, check the job ID from the error
orc jobs status JOB_ID --json
# 4. If step 3 shows completion, retrieve the result for the same job ID
orc jobs result JOB_ID --json

1. Inspect the image model

terminal
orc image models get gpt-image-2 --json

Confirm that data.model.id is gpt-image-2. Check the supported inputs in capabilities and constraints. If you get HTTP 404, check the model ID and the selected workspace. Image

2. Generate the image and wait for completion

terminal
orc image generate --model gpt-image-2 --prompt "A red cube on a white background" --wait --timeout 5m --json

--wait checks job status and retrieves the result when the job completes. Check for exit code 0 and an image url in data.result.artifacts. If the command reports Timed out waiting for creative job JOB_ID., it exits with code 1. Save error.context.id and check the status of that job. Image · Jobs · Global options

3. Check the job after a timeout

terminal
orc jobs status JOB_ID --json

Replace JOB_ID with the saved ID and use the same workspace as the generation request. If data.status is COMPLETED, retrieve the result. If it is IN_QUEUE or IN_PROGRESS, check the same job again. Stop waiting if it reaches FAILED or CANCELED. If you get HTTP 404, check the job ID and workspace. Jobs

4. Retrieve the completed job result

terminal
orc jobs result JOB_ID --json

Use the url in data.result.artifacts to view the image. If the result request returns HTTP 409, check the status of the same job ID. Jobs

Generate a video from an image

Use an image at a public HTTPS URL as the start frame. Check that the video model supports image input, then generate the video and retrieve its URL.

Quick reference

terminal
# 1. Check that the model accepts a start frame
orc video models get seedance-2.5 --json
# 2. Replace the image URL, generate the video, and wait for the result
orc video generate --model seedance-2.5 --prompt "Slow push-in" --image-url https://example.com/start.png --wait --timeout 10m --json
# 3. If the wait times out, check the job ID from the error
orc jobs status JOB_ID --json
# 4. If step 3 shows completion, retrieve the result for the same job ID
orc jobs result JOB_ID --json

1. Check that the model accepts a start frame

terminal
orc video models get seedance-2.5 --json

Check capabilities and constraints in data.model to confirm that you can supply a start image. If you get HTTP 404, check the model ID and the selected workspace. Video

2. Pass the start image and generate the video

terminal
orc video generate --model seedance-2.5 --prompt "Slow push-in" --image-url https://example.com/start.png --wait --timeout 10m --json

Replace the example URL with the public HTTPS URL of your start image. Check for exit code 0 and a video url in data.result.artifacts. If the command exits with code 1 and error.category is timeout, save error.context.id and check the same job. Video · Jobs

3. Check the job after a timeout

terminal
orc jobs status JOB_ID --json

Replace JOB_ID with the saved ID and use the same workspace as the generation request. If data.status is COMPLETED, retrieve the result. If it is IN_QUEUE or IN_PROGRESS, check the same job again. Stop waiting if it reaches FAILED or CANCELED. If you get HTTP 404, check the job ID and workspace. Jobs

4. Retrieve the completed job result

terminal
orc jobs result JOB_ID --json

Use the url in data.result.artifacts to view the video. If the result request returns HTTP 409, check the status of the same job ID. Jobs

Check credit balances and usage

Check the credits available under the workspace's contract, the prepaid USD balance, and usage for a fixed time range. The output examples are abbreviated and use placeholder values.

Quick reference

terminal
# 1. Replace WORKSPACE_ID with the target ID and check the contract and credits
orc billing current --workspace WORKSPACE_ID --json
# 2. Read the prepaid USD balance for the same workspace
orc billing balance get --workspace WORKSPACE_ID --json
# 3. Read usage for the same workspace over a fixed time range
orc usage get --workspace WORKSPACE_ID --start-time 2026-09-01T00:00:00Z --end-time 2026-10-01T00:00:00Z --json

1. Check the credits available under the contract

terminal
orc billing current --workspace WORKSPACE_ID --json

Replace WORKSPACE_ID with the ID of the workspace you want to inspect. When success is true, data.creditBalance shows remaining API credits and data.creativeCreditBalance shows remaining creative credits. If the request returns HTTP 403 and the command exits with code 1, check the workspace and credential permissions. Billing

{"success":true,"data":{"creditBalance":0,"creativeCreditBalance":0}}

2. Check the prepaid USD balance

terminal
orc billing balance get --workspace WORKSPACE_ID --json

When success is true, read data.balance for the display amount in USD and data.balance_micros for the exact balance in microdollars. If error.category is auth, check that the active credentials can read the balance for that workspace. Billing

{"success":true,"data":{"balance":0,"balance_micros":0,"currency":"USD"}}

3. Check usage for the time range

terminal
orc usage get --workspace WORKSPACE_ID --start-time 2026-09-01T00:00:00Z --end-time 2026-10-01T00:00:00Z --json

Set the start and end timestamps for the range you want to inspect. The start is inclusive and the end is exclusive. When success is true, check request_count and credits_used in each bucket's results. If the command exits with code 2 and error.category is validation, check the RFC 3339 timestamps and confirm the end is after the start. Usage

{"success":true,"data":[{"results":[{"request_count":0,"credits_used":0}]}]}

Set up skills and MCP for Codex

Install the bundled Codex skills in your project directory. Connect Codex to the hosted Orchestor MCP server, then verify the connection by listing image models.

Quick reference

terminal
# 1. Install the project skills
orc setup skills --agent codex
# 2. Verify installation
orc setup skills --agent codex --status
# 3. Register MCP in Codex and authorize it in your browser
codex mcp add orchestor --url https://mcp.orchestor.io/mcp
codex mcp login orchestor
codex mcp list

1. Install project skills

terminal
orc setup skills --agent codex

Run the command from your project directory. Check the installation summary for 0 failed. If the command exits with code 1 and reports failed to copy embedded skill, inspect the path and error details it prints. Setup · Agent skills

2. Verify the skills installation

terminal
orc setup skills --agent codex --status

Check for canonical=installed on the rows for the skills you need. Codex reads them from the project's .agents/skills directory. The command exits with code 1 if it finds broken or version-drift. If you see either state, missing, or conflict, inspect the installation paths in the output. Setup

3. Connect Codex to Orchestor MCP

terminal
codex mcp add orchestor --url https://mcp.orchestor.io/mcp
codex mcp login orchestor
codex mcp list

If you already registered the server, start with codex mcp login orchestor. Select the workspace in your browser, verify the registration with codex mcp list, and reopen Codex. Ask Codex to use image_models_list. A list of model IDs confirms the connection. If the tool fails, check the server URL and the browser authorization. Connect Codex · List image models tool

How these workflows help AI agents

  • Choose the command for the task. Read model details to check supported inputs and job status to inspect an existing generation. Image · Video · Jobs
  • Begin troubleshooting with the exit code and the JSON error.category. After a timeout, check the job identified by error.context.id. Global options · Jobs
  • Pass the workspace ID or job ID returned by one command to the next step that needs it. Workspace · Jobs
  • Follow the same steps for a different model or workspace and check each result before moving on. CLI quickstart

Find CLI references from your terminal

Use the CLI index to find command descriptions and links to Markdown pages. Markdown and agent indexes

terminal
curl https://www.orchestor.io/docs/en/cli/llms.txt