Conway

API Introduction

Getting started with the Conway REST API.

The Conway REST API allows you to programmatically manage sandboxes and execute code. All API endpoints are available under the base URL:

https://api.conway.tech/v1

Authentication

All API requests must be authenticated with an API key. You can create an API key from the Conway dashboard.

Include your API key in the Authorization header as a Bearer token:

Authorization: Bearer your-api-key-here

Example

curl https://api.conway.tech/v1/sandboxes \
  -H "Authorization: Bearer your-api-key-here"
const response = await fetch("https://api.conway.tech/v1/sandboxes", {
  headers: {
    Authorization: "Bearer your-api-key-here",
  },
});

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

Status CodeDescription
200Success
201Created
204No Content (success, no body)
400Bad Request - invalid parameters
401Unauthorized - invalid or missing API key
403Forbidden - insufficient permissions
404Not Found - resource doesn't exist
429Too Many Requests - rate limited
500Internal Server Error

When an error occurs, the API returns a JSON object with an error field:

{
  "error": "Invalid API key"
}

API Sections

  • Sandboxes - Create, get, list, and delete sandboxes
  • Execution - Execute commands and code in sandboxes
  • Files - Upload, download, and list files
  • PTY - Create and manage pseudo-terminal sessions
  • Ports - Expose and unexpose ports
  • Inference - OpenAI-compatible chat completions, billed from credits