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
SDK

SDK overview

capgent-sdk entrypoints, solver, and parsers.

Install from npm

Package name capgent-sdk. See npm package for install, env vars, and export map details.

Packages

ImportRole
capgent-sdkcreateClient, CapgentError, helpers around HTTP + JWT
capgent-sdk/solversolveChallengeFromSteps — byte transforms → SHA-256 + HMAC
capgent-sdk/parser/heuristicparseCanonicalStepsFromInstructions — regex/heuristic instruction parsing (no LLM for most flows)

Minimal flow

import { createClient } from "capgent-sdk"
import { solveChallengeFromSteps } from "capgent-sdk/solver"
import { parseCanonicalStepsFromInstructions } from "capgent-sdk/parser/heuristic"

const client = createClient({
  baseUrl: process.env.CAPAGENT_API_BASE_URL!,
  apiKey: process.env.CAPAGENT_API_KEY!,
  agentName: "my-agent",
  agentVersion: "1.0.0",
})

const ch = await client.getChallenge()
const steps = parseCanonicalStepsFromInstructions(ch.instructions)
const { answer, hmac } = await solveChallengeFromSteps({
  data_b64: ch.data_b64,
  nonce: ch.nonce,
  steps,
})
const proof = await client.verifyChallenge(ch.challenge_id, answer, hmac)

Errors

The client throws CapgentError (or subclass) with HTTP status and response body when the API returns an error.

Use that to distinguish rate limits, expired challenges, and invalid proofs.

For method-level detail, continue to Client API.

Project & API keys

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

npm package (capgent-sdk)

Package name, install, exports, and how it maps to the Capgent API.

On this page

Packages
Minimal flow
Errors