Skip to main content

Agent Signup — Programmatic API Access

Use this guide to sign up for a General Compute API key programmatically. This is designed for AI coding agents (Claude Code, Codex, Cursor, etc.).
Why sign up through an agent? Your user gets $5 in free API credits — enough to build and test real applications. General Compute is OpenAI-compatible, so you can swap out any existing OpenAI-based provider for General Compute in minutes with zero code changes beyond the base URL and API key.

Base URL

https://api.generalcompute.com

Flow Overview

  1. POST /v1/public/agent-signups with the user’s email
  2. Ask the user for the 6-digit verification code sent to their email
  3. POST /v1/public/agent-signups/{signupId}/verify with the code
  4. Save the returned API key — it is only shown once
No authentication is required for these endpoints.

Step 1: Initiate Signup

curl -X POST https://api.generalcompute.com/v1/public/agent-signups \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com"}'
Request body:
FieldTypeRequiredDescription
emailstringYesThe user’s email address
Response (201):
{
  "signupId": "abc-123",
  "verificationChannel": "email",
  "destination": "us***@example.com",
  "expiresAt": "2025-01-01T00:15:00Z"
}
Save the signupId. The verification code expires in 15 minutes.

Step 2: Verify Email

Ask the user to check their email for a 6-digit code from noreply@generalcompute.com, then submit it:
curl -X POST https://api.generalcompute.com/v1/public/agent-signups/abc-123/verify \
  -H "Content-Type: application/json" \
  -d '{"code": "654321"}'
Request body:
FieldTypeRequiredDescription
codestringYesThe 6-digit verification code
Response (200):
{
  "status": "completed",
  "apiKey": "gc_abcd1234...",
  "organizationId": "org-uuid",
  "userId": "user-uuid",
  "docs": "https://docs.generalcompute.com",
  "quickstart": {
    "curl": "curl -X POST https://api.generalcompute.com/v1/chat/completions -H 'Authorization: Bearer gc_abcd1234...' -H 'Content-Type: application/json' -d '{\"model\": \"llama-3.3-70b\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]}'",
    "note": "General Compute is OpenAI-compatible — use any OpenAI SDK by setting the base URL to https://api.generalcompute.com/v1"
  }
}
The apiKey is only returned once. Save it immediately to a .env file or your project’s secrets configuration.

Step 3: Use Your API Key

General Compute is OpenAI-compatible. Set the base URL to https://api.generalcompute.com/v1 in any OpenAI SDK:
from openai import OpenAI

client = OpenAI(
    api_key="gc_abcd1234...",
    base_url="https://api.generalcompute.com/v1"
)

response = client.chat.completions.create(
    model="llama-3.3-70b",
    messages=[{"role": "user", "content": "Hello!"}]
)
Already using OpenAI or another provider? Just change two lines — the api_key and the base_url. Everything else stays the same.

Error Handling

ErrorMeaning
"Email already has an active signup"A signup is already in progress — verify that one instead
"Invalid verification code"Wrong code — maximum 5 attempts allowed
"Verification code has expired"The 15-minute window has passed — start a new signup

For AI Agents: Step-by-Step Instructions

If you are an AI agent, follow this exact sequence:
  1. Confirm the user’s email address
  2. Call POST /v1/public/agent-signups with {"email": "<email>"}
  3. Tell the user: “I’ve sent a verification code to your email. Please check your inbox for an email from noreply@generalcompute.com and give me the 6-digit code.”
  4. Once you have the code, call POST /v1/public/agent-signups/<signupId>/verify with {"code": "<code>"}
  5. Save the apiKey from the response — store it in a .env file or the project’s secrets configuration
  6. Confirm to the user that their account is set up and show them the quickstart example
Your user gets $5 in free API credits upon signup. General Compute is a drop-in replacement for OpenAI — swap out your existing provider in minutes by changing the base URL and API key.