API Documentation

OpenAI-compatible API for distributed inference on Apple Silicon.

BASE URL

https://api.repogen.xyz/v1

Quick Start

1

Get your API key

Visit dashboard

2

Deposit USDC on Base

Minimum $1

3

Make a request

Use OpenAI SDK

from openai import OpenAI

client = OpenAI(
    base_url="https://api.repogen.xyz/v1",
    api_key="rg_live_xxxxx"
)

response = client.chat.completions.create(
    model="gpt-oss-20b",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)

Authentication

Use Bearer token in the Authorization header.

Authorization: Bearer rg_live_xxxxx

Never expose API keys in client-side code.

Chat Completions

POST/v1/chat/completions

Parameters

modelrequired
messagesrequired
streamoptional
temperatureoptional
max_tokensoptional

Response

{
  "id": "chatcmpl-abc123",
  "model": "gpt-oss-20b",
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "Hello!"
    }
  }],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 9
  }
}

Streaming

Set stream: true for SSE responses.

data: {"choices":[{"delta":{"content":"Hello"}}]}
data: {"choices":[{"delta":{"content":"!"}}]}
data: [DONE]

Models

Prices per million tokens.

gpt-oss-20b

GPT-OSS 20B · MoE

$0.02 in

$0.06 out

gemma-4-26b

Gemma 4 26B · MoE

$0.02 in

$0.06 out

Billing

  • • Deposit USDC on Base
  • • Pay per token consumed
  • • 100% to providers during alpha
GET/v1/balance

Rate Limits

Free10 req/min
Paid100 req/min

Errors

400Bad Request
401Unauthorized
402Payment Required
429Rate Limited
500Internal Error
503Unavailable

For Providers

Run inference on your Mac and earn USDC.

Terminal
# Download CLI
curl -L https://github.com/topguyaii/repogen-inference/releases/download/v0.1.0-alpha/repogen-macos-arm64.tar.gz | tar xz
sudo mv repogen /usr/local/bin/

# Verify & run
repogen doctor
repogen models download gpt-oss-20b
repogen start --foreground

Requirements

  • • macOS 14.0+ (Sonoma)
  • • Apple Silicon (M1/M2/M3/M4)
  • • 8GB+ unified memory