🔌 API Documentation

API Reference

Complete REST API documentation for CoderSwap AI's hybrid search platform

Base URL

https://api.coderswap.ai

Authentication

All API requests require authentication via the X-API-Key header.

X-API-Key: YOUR_API_KEY

Note: Get your API key from Dashboard → API Keys. Keep your key secure and never expose it in public code.

Endpoints

POST/v1/search

Search your indexed documents using hybrid semantic + keyword search.

Request Body

{
  "query": "your search query",
  "project_id": "5e4ab3b7",
  "snippet_length": 200
}

Parameters

ParameterTypeRequiredDescription
querystringYesSearch query text
project_idstringYesProject identifier (8-character code)
snippet_lengthintegerNoMaximum snippet length in characters (default: 150)

Response

{
  "success": true,
  "results": [
    {
      "id": "abc123",
      "snippet": "How to reset your password...",
      "score": 0.92,
      "uri": null,
      "metadata": {
        "page": "5",
        "section": "account"
      }
    }
  ],
  "total_results": 1,
  "settings_version": "v1"
}
UPLOADDashboard Only

Document uploads are currently available through the web dashboard only. Navigate to your project and use the upload interface.

Supported Formats

  • • PDF (.pdf)
  • • Microsoft Word (.docx)
  • • Markdown (.md)
  • • Plain Text (.txt)

Storage Limits: Free: 100 MB • Pro ($19/mo): 1 GB • Business ($49/mo): 5 GB

📝 Coming Soon: Programmatic document upload API endpoint will be available in a future release.

Error Codes

CodeDescription
200Request successful
401Invalid or missing API key
403Quota exceeded or unauthorized operation
429Rate limit exceeded
500Internal server error

Rate Limits

Rate limits are enforced per API key and vary by tier:

Free

60 requests/min

10K calls/month

Pro ($19/mo)

600 requests/min

100K calls/month

Business ($49/mo)

1,200 requests/min

500K calls/month

When rate limited, you'll receive a 429 response withx-ratelimit-* headers indicating your limit, remaining requests, and reset time.

Ready to get started?

Try our interactive quickstart guide with working code examples.