Agentbook API

Welcome to the Agentbook API documentation. The Agentbook API is a RESTful API that allows you to programmatically access and manage agents, users, reviews, and more on the Agentbook platform.

Base URL
https://aiagentbook.org/api/v1
Content-Type
application/json
Version
v1.0.0

Authentication

The Agentbook API uses Bearer Token authentication via Laravel Sanctum. Include your API token in the Authorization header.

Authorization Header
Authorization: Bearer {your-token}
Creating a Token

To create an API token, visit your account settings or use the token creation endpoint (requires web authentication). Tokens are scoped to your user account and respect your plan's rate limits.

Rate Limits

API requests are rate-limited based on your plan. Exceeding these limits will result in a 429 Too Many Requests response.

Free Plan
60 requests/minute (public) / 100 requests/minute (authenticated)
Pro Plan
60 requests/minute (public) / 300 requests/minute (authenticated)
Team Plan
60 requests/minute (public) / 500 requests/minute (authenticated)
Enterprise
60 requests/minute (public) / 1000 requests/minute (authenticated)

Write operations (POST, PUT, DELETE) have stricter limits: Free (30/min), Pro (100/min), Team (150/min), Enterprise (300/min).

Errors

The API uses standard HTTP response codes. 2xx codes indicate success, 4xx codes indicate client errors, and 5xx codes indicate server errors.

GET /health Check API status
200 Success - The request was successful
201 Created - Resource was successfully created
400 Bad Request - The request was malformed
401 Unauthorized - Authentication required
403 Forbidden - Insufficient permissions
404 Not Found - Resource not found
422 Validation Error - Input validation failed
429 Too Many Requests - Rate limit exceeded
500 Server Error - Internal server error

Agents

Manage agents on the Agentbook platform. Agents can be created, updated, starred, forked, and followed.

GET /agents List all agents

Returns a paginated list of agents. Supports filtering by search query, category, and sorting.

Query Parameters
Name Type Required Description
search string No Search query string
category string No Filter by category
sort enum No Sort by: popular, recent, rating, name (default: recent)
per_page integer No Items per page (1-100, default: 12)
page integer No Page number (default: 1)
Example Response
200 OK
{ "data": [ { "id": 1, "name": "Code Assistant", "slug": "code-assistant", "description": "AI-powered coding assistant", "category": "developer-tools", "stars_count": 42, "average_rating": 4.5, "user": { "id": 1, "name": "John Doe", "username": "johndoe" } } ], "meta": { "current_page": 1, "last_page": 5, "per_page": 12, "total": 50 } }
Code Examples
const API_TOKEN = 'your-api-token'; const BASE_URL = 'https://agentbook.dev/api/v1'; async function listAgents() { const url = new URL('/agents', BASE_URL); url.searchParams.append('sort', 'popular'); url.searchParams.append('per_page', '12'); const options = { method: 'GET', headers: { 'Authorization': `Bearer ${API_TOKEN}`, 'Content-Type': 'application/json', 'Accept': 'application/json', }, }; try { const response = await fetch(url, options); if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`); const data = await response.json(); console.log('Success:', data); return data; } catch (error) { console.error('Error:', error); throw error; } } // Usage listAgents();
import requests import json API_TOKEN = 'your-api-token' BASE_URL = 'https://agentbook.dev/api/v1' def list_agents(): url = f"{BASE_URL}/agents" params = { 'sort': 'popular', 'per_page': 12 } headers = { 'Authorization': f'Bearer {API_TOKEN}', 'Content-Type': 'application/json', 'Accept': 'application/json', } try: response = requests.get(url, headers=headers, params=params, timeout=30) response.raise_for_status() data = response.json() print('Success:', json.dumps(data, indent=2)) return data except requests.exceptions.RequestException as e: print(f'Error: {e}') raise # Usage if __name__ == '__main__': list_agents()
<?php require_once 'vendor/autoload.php'; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; const API_TOKEN = 'your-api-token'; const BASE_URL = 'https://agentbook.dev/api/v1'; function listAgents(): array { $client = new Client([ 'base_uri' => BASE_URL, 'timeout' => 30, 'headers' => [ 'Authorization' => 'Bearer ' . API_TOKEN, 'Accept' => 'application/json', ], ]); try { $response = $client->get('/agents', [ 'query' => [ 'sort' => 'popular', 'per_page' => 12 ] ]); $data = json_decode($response->getBody(), true); echo 'Success: ' . json_encode($data, JSON_PRETTY_PRINT) . PHP_EOL; return $data; } catch (RequestException $e) { echo 'Error: ' . $e->getMessage() . PHP_EOL; throw $e; } } // Usage listAgents();
package main import ( "encoding/json" "fmt" "io" "net/http" "time" ) const ( API_TOKEN = "your-api-token" BASE_URL = "https://agentbook.dev/api/v1" ) func ListAgents() (map[string]interface{}, error) { url := BASE_URL + "/agents?sort=popular&per_page=12" req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Authorization", "Bearer "+API_TOKEN) req.Header.Set("Accept", "application/json") client := &http.Client{Timeout: 30 * time.Second} resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("error making request: %w", err) } defer resp.Body.Close() if resp.StatusCode >= 400 { body, _ := io.ReadAll(resp.Body) return nil, fmt.Errorf("HTTP %d: %s", resp.StatusCode, string(body)) } var result map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { return nil, fmt.Errorf("error decoding response: %w", err) } fmt.Printf("Success: %+v\n", result) return result, nil } func main() { if _, err := ListAgents(); err != nil { fmt.Printf("Error: %v\n", err) } }
require 'net/http' require 'json' require 'uri' API_TOKEN = 'your-api-token' BASE_URL = 'https://agentbook.dev/api/v1' def list_agents uri = URI.parse("#{BASE_URL}/agents?sort=popular&per_page=12") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.read_timeout = 30 request = Net::HTTP::Get.new(uri.request_uri) request['Authorization'] = "Bearer #{API_TOKEN}" request['Accept'] = 'application/json' begin response = http.request(request) case response when Net::HTTPSuccess data = JSON.parse(response.body) puts "Success: #{JSON.pretty_generate(data)}" data else raise "HTTP Error: #{response.code} - #{response.body}" end rescue StandardError => e puts "Error: #{e.message}" raise end end # Usage list_agents
POST /agents Create a new agent

Creates a new agent. Requires authentication.

Request Body
JSON Body
{ "name": "Code Assistant", "tagline": "Your AI coding companion", "description": "A helpful AI assistant for coding tasks", "category": "developer-tools", "capabilities": ["code-generation", "code-review"], "tech_stack": ["python", "javascript"], "visibility": "public", "license": "MIT", "is_open_source": true }
Response Codes
201 Agent created successfully
422 Validation error
GET /agents/{slug} Get agent details

Returns detailed information about a specific agent.

Path Parameters
Name Type Required Description
slug string Yes Agent slug identifier
PUT /agents/{slug} Update an agent

Updates an existing agent. Requires authentication and ownership.

DELETE /agents/{slug} Delete an agent

Deletes an agent. Requires authentication and ownership.

POST /agents/{slug}/star Star/unstar agent

Toggles the star status for an agent. Requires authentication.

POST /agents/{slug}/fork Fork an agent

Creates a fork of an existing agent. Requires authentication.

POST /agents/{slug}/follow Follow/unfollow agent

Toggles the follow status for an agent. Requires authentication.

Users

Access user information and profiles.

GET /users/{username} Get user profile

Returns public information about a user.

GET /user Get current user

Returns information about the authenticated user. Requires authentication.

Reviews

Manage reviews and ratings for agents.

GET /agents/{slug}/reviews List agent reviews

Returns reviews for a specific agent with rating distribution.

POST /agents/{slug}/reviews Create review

Creates a new review for an agent. Requires authentication. Each user can only review an agent once.

Request Body
JSON Body
{ "rating": 5, "title": "Excellent agent!", "body": "This agent has been incredibly helpful for my workflow." }
PUT /agents/{slug}/reviews/{review} Update review

Updates an existing review. Requires authentication and ownership.

DELETE /agents/{slug}/reviews/{review} Delete review

Deletes a review. Requires authentication and ownership.

POST /agents/{slug}/reviews/{review}/helpful Mark as helpful

Marks a review as helpful. Requires authentication.

Authentication

Manage API tokens for authentication.

POST /tokens/create Create API token

Creates a new API token for authentication. Token limits vary by plan.

Request Body
JSON Body
{ "name": "My App Token", "expires_at": "2026-12-31T23:59:59Z", "abilities": ["read", "write"] }
Response
201 Created
{ "message": "Token created successfully", "data": { "name": "My App Token", "token": "1|laravel_sanctum_token_xxxxxxxx", "abilities": ["read", "write"], "expires_at": "2026-12-31T23:59:59.000000Z", "created_at": "2026-03-20T10:00:00.000000Z" } }
Token Limits by Plan
Plan Max Tokens
Free1 token
Pro5 tokens
Team10 tokens
Enterprise50 tokens

Agent Schema

id integer Unique identifier
name string Agent name
slug string URL-friendly identifier
description string Detailed description
category string Agent category
stars_count integer Number of stars
forks_count integer Number of forks
followers_count integer Number of followers
average_rating float Average rating (1-5)
is_verified boolean Verified badge status
created_at datetime Creation timestamp
updated_at datetime Last update timestamp

User Schema

id integer Unique identifier
name string Display name
username string Unique username
email string Email address (private)
bio string User bio
verified boolean Verified account
plan string Current plan (free, pro, team, enterprise)

Review Schema

id integer Unique identifier
rating integer Rating (1-5)
title string Review title
body string Review content
helpful_count integer Number of helpful votes
created_at datetime Creation timestamp