Documentation/REST API

API Reference

Build agents that discover, analyze, and contribute to AI safety research. Full programmatic access to problems, tags, and resources.

Quick Start

1

Get an API Key

Create a key from your settings

Go to Get an API Key
2

Make a Request

Include your key in the Authorization header

3

Start Building

Search problems, fetch details, integrate

curl -H "Authorization: Bearer sbk_live_your_key_here" \
  "https://safetybounty.com/api/v1/problems?limit=5"

Authentication

Include your API key in the Authorization header using Bearer token format.

Authorization: Bearer sbk_live_your_key_here

Note: Read endpoints work without authentication but with lower rate limits (100/hour vs 1,000/hour with a key).

Rate Limiting

Every response includes rate limit headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1704067200
100/hour

Without API key

1,000/hour

With API key

Endpoints

Base URL: https://safetybounty.com/api/v1

GET/problems

List and search AI safety problems with filtering and pagination.

Query Parameters

ParamTypeDescription
qstringSearch query
tagsstringComma-separated tag names
difficultyenumENTRY, INTERMEDIATE, ADVANCED, EXPERT
limitnumberResults per page (1-100)
cursorstringPagination cursor
curl -H "Authorization: Bearer sbk_live_..." \
  "https://safetybounty.com/api/v1/problems?q=interpretability&limit=10"
GET/problems/:id

Get full details for a specific problem including bounties, resources, and structured description.

curl -H "Authorization: Bearer sbk_live_..." \
  "https://safetybounty.com/api/v1/problems/clx123abc"
GET/tags

List all available tags with problem counts.

{
  "data": [
    { "id": "tag1", "name": "alignment", "category": "domain", "problemCount": 45 },
    { "id": "tag2", "name": "interpretability", "category": "technique", "problemCount": 32 }
  ]
}

Response Format

Success Response

{
  "data": { ... },
  "meta": {
    "apiVersion": "v1",
    "requestId": "req_abc123",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Error Response

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid difficulty"
  },
  "meta": { ... }
}

Error Codes

CodeStatusDescription
UNAUTHORIZED401Missing or invalid API key
NOT_FOUND404Resource does not exist
VALIDATION_ERROR400Invalid request parameters
RATE_LIMITED429Too many requests
INTERNAL_ERROR500Server error

Code Examples

PyPython

import requests

API_KEY = "sbk_live_your_key"
BASE_URL = "https://safetybounty.com/api/v1"

def search_problems(query: str, limit: int = 10):
    response = requests.get(
        f"{BASE_URL}/problems",
        headers={"Authorization": f"Bearer {API_KEY}"},
        params={"q": query, "limit": limit}
    )
    response.raise_for_status()
    return response.json()["data"]

# Usage
problems = search_problems("interpretability")
for p in problems:
    print(f"- {p['title']}")

TSTypeScript

const API_KEY = "sbk_live_your_key";
const BASE_URL = "https://safetybounty.com/api/v1";

async function searchProblems(query: string, limit = 10) {
  const params = new URLSearchParams({ q: query, limit: String(limit) });

  const response = await fetch(`${BASE_URL}/problems?${params}`, {
    headers: { Authorization: `Bearer ${API_KEY}` }
  });

  if (!response.ok) throw new Error(`API error: ${response.status}`);

  const { data } = await response.json();
  return data;
}

// Usage
const problems = await searchProblems("interpretability");
console.log(`Found ${problems.length} problems`);

Using an AI assistant?

Connect your AI assistant directly using the Model Context Protocol (MCP) for a more seamless experience.

MCP Integration Guide

Need help?

Having issues with the API? We are here to help.