Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agenhq.com/llms.txt

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

Get started with the Coding Agent API

Use the Coding Agent API to create and manage Agen coding sessions programmatically. Before you make your first request, you need an Agen account, a workspace, an API key, and at least one connected repository.

Prerequisites

Make sure you have the following ready:
  • An Agen Web Portal account
  • A workspace where you want to run coding sessions
  • A repository connected to that workspace
  • An API client such as curl, Postman, or your application backend

Step 1: Set up your Agen workspace

  1. Sign in to the Agen Web Portal.
  2. Create a workspace if you do not already have one.
  3. Open the workspace and connect the repository you want the agent to work on.
  4. Verify the repository has the permissions Agen needs to read, branch, and open changes safely.
If you have not done this yet, review the main Quickstart guide for a broader walkthrough of setting up Agen.

Step 2: Get your API key

  1. In the Agen Web Portal, open your workspace.
  2. Navigate to the API settings or developer settings area for your workspace.
  3. Generate a new API key.
  4. Copy the key and store it in a secure secret manager or environment variable.
Do not hardcode API keys in source control or expose them in client-side applications. Keep them on a trusted backend or in secure local environment variables.
For example:
export AGEN_API_KEY="your_api_key_here"

Step 3: Confirm the API base URL

Use the Coding Agent API reference in this docs section together with your API key to authenticate requests. If your team uses a hosted Agen environment, use the API base URL provided with that environment. When sending requests, include your API key as a bearer token:
curl https://api.agen.ai/v1/sessions \
  -H "Authorization: Bearer $AGEN_API_KEY"

Step 4: Make your first API request

A common first step is to inspect the available endpoints in this reference and then create or manage a session for a repository in your workspace. You can use the interactive API reference on this page set to:
  • Review available endpoints
  • Understand request and response schemas
  • Test requests with your API key in a safe development environment

Next steps

API reference

Explore the full Coding Agent API reference and available endpoints.

Schemas

Review the session schema used by the Coding Agent API.