API Docs.

Everything you need to generate Reddit OAuth tokens with a single API call.

Quick Start

Three steps to your first Reddit token:

  1. Get your API key ($39.95/month, cancel anytime)
  2. Call POST /v1/token with your key to get a Reddit OAuth token
  3. Use that token with Reddit's API for 24 hours, then request a new one
Full example
# Step 1: Get a Reddit token from ThoughtLab
curl -X POST https://thoughtlab.cloud/v1/token \
  -H "Authorization: Bearer sk_live_your_key_here"

# Response: {"ok":true,"token":"eyJhbG...","expires_in":86400}

# Step 2: Use that token with Reddit's API
curl https://oauth.reddit.com/r/programming/new \
  -H "Authorization: bearer eyJhbG..."
That's it. One token works for all Reddit API endpoints (read access) for 24 hours. No need to request more than one per day unless you have a specific reason.
Authentication

Every request to the ThoughtLab API requires your API key as a Bearer token:

Authorization: Bearer sk_live_your_key_here

Your key starts with sk_live_ followed by 32 characters. Keep it secret — anyone with your key can use your account.

Endpoints
POST /v1/token

Generate a Reddit OAuth bearer token. Each token is valid for 24 hours and provides full read access to Reddit's API.

Response
{
    "ok": true,
    "token": "eyJhbGci...",
    "expires_in": 86400
}
Code snippets
cURL
PHP
Python
JavaScript
curl -X POST https://thoughtlab.cloud/v1/token \
  -H "Authorization: Bearer sk_live_your_key_here"
$ch = curl_init('https://thoughtlab.cloud/v1/token');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer sk_live_your_key_here'
    ],
]);
$data  = json_decode(curl_exec($ch), true);
$token = $data['token'];
curl_close($ch);

// Now use $token with Reddit's API
$ch = curl_init('https://oauth.reddit.com/r/programming/new');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ["Authorization: bearer $token"],
]);
$posts = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests

# Get token from ThoughtLab
r = requests.post(
    'https://thoughtlab.cloud/v1/token',
    headers={'Authorization': 'Bearer sk_live_your_key_here'}
)
token = r.json()['token']

# Use token with Reddit's API
posts = requests.get(
    'https://oauth.reddit.com/r/programming/new',
    headers={'Authorization': f'bearer {token}'}
).json()
// Get token from ThoughtLab
const res = await fetch('https://thoughtlab.cloud/v1/token', {
    method: 'POST',
    headers: { 'Authorization': 'Bearer sk_live_your_key_here' }
});
const { token } = await res.json();

// Use token with Reddit's API
const posts = await fetch('https://oauth.reddit.com/r/programming/new', {
    headers: { 'Authorization': `bearer ${token}` }
}).then(r => r.json());
GET /v1/status

Check your API key's status and see how many tokens you've used today.

Response
{
    "ok": true,
    "status": "active",
    "expires_at": "2027-04-06 00:00:00",
    "usage": {
        "tokens_today": 1,
        "tokens_this_hour": 0,
        "limit_per_hour": 2,
        "limit_per_day": 3
    }
}
POST /v1/key/rotate

Replace your API key with a new one. Your old key stops working immediately. Limited to once per 24 hours.

Response
{
    "ok": true,
    "api_key": "sk_live_new_key_here",
    "message": "Key rotated — your old key is now invalid"
}
Save the new key immediately. The old key is permanently invalidated. Update any applications using the old key.
Rate Limits
LimitAmount
Per hour2 tokens
Per day3 tokens
Key rotationOnce per 24 hours

Each token lasts 24 hours, so 3 per day is more than enough for normal use. When rate limited, the response includes a Retry-After: 60 header.

Using the Token with Reddit

The token you receive is a standard Reddit OAuth bearer token. Use it in the Authorization header when calling Reddit's API:

Authorization: bearer eyJhbGci...
What you can do with it

The token provides read access to Reddit's OAuth API. Common endpoints:

Reddit EndpointDescription
/r/{subreddit}/newNew posts in a subreddit
/r/{subreddit}/hotHot posts in a subreddit
/user/{username}/aboutUser profile info
/user/{username}/overviewUser's posts and comments
/user/{username}/submittedUser's posts only
/user/{username}/commentsUser's comments only

All Reddit API requests go to https://oauth.reddit.com (not www.reddit.com).

Error Codes
HTTPCodeMeaning
401MISSING_KEYNo Authorization header or malformed key
401INVALID_KEYKey does not exist
401KEY_REVOKEDKey has been permanently revoked
402LICENSE_SUSPENDEDPayment failed — update billing info
402LICENSE_EXPIREDLicense has expired
429RATE_LIMITEDExceeded hourly or daily token limit
429ROTATE_COOLDOWNKey already rotated in the last 24 hours
502TOKEN_GENERATION_FAILEDReddit upstream error — retry shortly

All errors follow this format:

{
    "ok": false,
    "error": "Human-readable message",
    "code": "ERROR_CODE"
}

Ready to start generating tokens?

Get Your API Key
One call.
One token.
// That's it. Seriously.
curl -X POST thoughtlab.cloud/v1/token \
  -H "Authorization: Bearer sk_live_..."

// Returns a 24hr Reddit OAuth token
{ "token": "eyJhbG...", "expires_in": 86400 }