Documentation

Four agents, four endpoints. Here's how to use them.

Quick Start

1

Get API Key

Create an account and generate your API key from the dashboard.

2

Make Request

Send a POST request with your API key in the header.

3

Get Results

Receive structured JSON with the agent's response.

Authentication

All requests require an API key. Include it in one of these headers:

x-api-key: your_api_key
Authorization: Bearer your_api_key

Note: Keep your API key secure. Never expose it in client-side code.

Search Agent

POST

Searches the web and returns structured results with sources.

/api/search

Request Body

{
  "messages": [
    {
      "role": "user",
      "content": "Latest developments in AI"
    }
  ]
}

Response

{
  "text": "Here are the latest AI developments...",
  "sources": [
    "https://example.com/ai-news",
    "https://example.com/research"
  ]
}

cURL Example

curl -X POST https://api.scira.ai/api/search \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "messages": [{
      "role": "user",
      "content": "Latest developments in AI"
    }]
  }'

People Agent

POST

Finds and enriches people profiles across LinkedIn, GitHub, X, and more.

/api/people

Request Body

{
  "query": "Andrej Karpathy AI researcher"
}

Response

{
  "profile": {
    "name": "Andrej Karpathy",
    "x": "https://x.com/karpathy",
    "linkedin": "https://linkedin.com/in/andrej-karpathy",
    "github": "https://github.com/karpathy",
    "website": "https://karpathy.ai/",
    "bio": "AI researcher, former Tesla AI director..."
  }
}

cURL Example

curl -X POST https://api.scira.ai/api/people \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "query": "Andrej Karpathy AI researcher"
  }'

Tip: Include context like company, role, or field for better results.

X Agent

POST

Searches X in real-time. Optionally target a specific user.

/api/xsearch

Request Body

{
  "query": "AI Gateway",
  "username": "vercel"
}

username is optional. Omit to search all of X.

Response

{
  "text": "## AI Gateway\n\n...markdown answer with inline citations...",
  "sources": [
    "https://x.com/vercel/status/123...",
    "https://x.com/vercel/status/456..."
  ],
  "results": [
    {
      "url": "https://x.com/vercel/status/123...",
      "title": "Tweet title",
      "text": "Tweet content from Exa...",
      "author": "vercel",
      "publishedDate": "2024-01-15T10:30:00.000Z",
      "tweet": {
        "id": "123...",
        "text": "Full tweet text...",
        "created_at": "Mon Jan 15 10:30:00 +0000 2024",
        "user": {
          "name": "Vercel",
          "screen_name": "vercel",
          "profile_image_url": "https://pbs.twimg.com/...",
          "verified": true
        },
        "favorite_count": 1234,
        "conversation_count": 56,
        "photos": [],
        "video": null
      }
    }
  ]
}

Each result includes enriched tweet data from the X API when available. The tweet field may be null if the tweet could not be fetched.

cURL Example

curl -X POST https://api.scira.ai/api/xsearch \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "query": "AI Gateway",
    "username": "vercel"
  }'

Reddit Agent

POST

Searches Reddit discussions and returns an agent summary with citations plus the underlying results.

/api/reddit

Request Body

{
  "query": "Best practices for deploying Next.js on Vercel?"
}

Response

{
  "text": "## Answer\n\n...markdown answer with inline citations...",
  "sources": [
    "https://www.reddit.com/r/...",
    "https://www.reddit.com/r/..."
  ],
  "results": [
    {
      "title": "Thread title",
      "url": "https://www.reddit.com/r/...",
      "excerpt": "Relevant excerpt..."
    }
  ]
}

cURL Example

curl -X POST https://api.scira.ai/api/reddit \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "query": "Best practices for deploying Next.js on Vercel?"
  }'

Errors

Standard HTTP status codes with JSON error messages.

401Unauthorized

API key missing or invalid.

429Too Many Requests

Rate limit or quota exceeded.

400Bad Request

Invalid request format or missing required fields.

500Server Error

Something went wrong on our end.

Error Response Format

{
  "error": "API key is required."
}