> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalcompute.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Signup

> Programmatic API access for AI coding agents. Sign up your user and get an API key in under 60 seconds.

# 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.).

<Note>
  **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.
</Note>

## 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

```bash theme={null}
curl -X POST https://api.generalcompute.com/v1/public/agent-signups \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com"}'
```

**Request body:**

| Field   | Type   | Required | Description              |
| ------- | ------ | -------- | ------------------------ |
| `email` | string | Yes      | The user's email address |

**Response (201):**

```json theme={null}
{
  "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:

```bash theme={null}
curl -X POST https://api.generalcompute.com/v1/public/agent-signups/abc-123/verify \
  -H "Content-Type: application/json" \
  -d '{"code": "654321"}'
```

**Request body:**

| Field  | Type   | Required | Description                   |
| ------ | ------ | -------- | ----------------------------- |
| `code` | string | Yes      | The 6-digit verification code |

**Response (200):**

```json theme={null}
{
  "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\": \"minimax-m2.7\", \"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"
  }
}
```

<Warning>
  **The `apiKey` is only returned once.** Save it immediately to a `.env` file or your project's secrets configuration.
</Warning>

***

## 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:

<CodeGroup>
  ```python Python theme={null}
  from openai import OpenAI

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

  response = client.chat.completions.create(
      model="minimax-m2.7",
      messages=[{"role": "user", "content": "Hello!"}]
  )
  ```

  ```typescript Node.js theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    apiKey: "gc_abcd1234...",
    baseURL: "https://api.generalcompute.com/v1",
  });

  const response = await client.chat.completions.create({
    model: "minimax-m2.7",
    messages: [{ role: "user", content: "Hello!" }],
  });
  ```
</CodeGroup>

Already using OpenAI or another provider? Just change two lines — the `api_key` and the `base_url`. Everything else stays the same.

***

## Error Handling

| Error                                  | Meaning                                                   |
| -------------------------------------- | --------------------------------------------------------- |
| `"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](mailto: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

<Note>
  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.
</Note>

<Card title="opencode Integration" icon="terminal" href="/opencode">
  Ready to switch your opencode session to General Compute? Follow the step-by-step guide to configure your auth and start using General Compute models.
</Card>
