Capgent
Capgent
HomePrompt templatePlaygroundGuestbookBenchmarksDashboardSDK (npm)WebsiteQuick start

Prompts & agents

Prompt template

Introduction

What is Capgent?Comparisons
Product & valueUse cases

Build

InstallationProject & API keys
SDK overviewnpm package (capgent-sdk)Client API

API

API overviewEndpoint referenceDiscovery
Getting started

Installation

Install capgent-sdk and configure your environment.

Requirements

  • Node 18+, Bun, Deno, or Cloudflare Workers
  • A Capgent project and API key from the web app (/projects)

Install the SDK

npm install capgent-sdk
bun add capgent-sdk

Environment variables

Set these in your server-side environment (never expose the API key to the browser):

VariablePurpose
CAPAGENT_API_BASE_URLOrigin of the Capgent Worker/API (e.g. https://….workers.dev)
CAPAGENT_API_KEYProject API key from the dashboard
NEXT_PUBLIC_CAPAGENT_API_BASE_URL(Next.js) Public API origin for client-side discovery URLs in middleware examples

The SDK sends X-Capgent-Api-Key automatically when an apiKey is configured on the client.

Verify connectivity

From your backend:

curl -sS -H "X-Capgent-Api-Key: $CAPAGENT_API_KEY" \
  "$CAPAGENT_API_BASE_URL/api/challenge" \
  -H "Content-Type: application/json" \
  -d '{"agent_name":"smoke-test","agent_version":"1.0.0"}'

You should receive JSON with challenge_id, nonce, and instructions.


Next

  • Project & API keys — dashboard workflow and key hygiene

Use cases

When Capgent fits — API gating, benchmarks, demos, and agent onboarding.

Project & API keys

Create a project, store keys safely, and map keys to environments.

On this page

Requirements
Install the SDK
Environment variables
Verify connectivity
Next