API Overview
Cortex provides a comprehensive REST API that serves as the trust layer between AI systems and the open web. This overview covers all available endpoints, authentication, and core concepts.
๐ Base URLโ
All API requests are made to:
https://api.usecortex.co/v1/
๐ Authenticationโ
All requests require authentication via API key:
Authorization: Bearer cortex_sk_your_api_key_here
Alternative header:
X-API-Key: cortex_sk_your_api_key_here
๐ Available Endpointsโ
Core Search & Extractionโ
| Endpoint | Method | Description |
|---|---|---|
/search | POST | Real-time web search with AI summaries |
/extract | POST | Clean text extraction from URLs |
/summarize | POST | AI-powered content summarization |
Trust & Validation Layerโ
| Endpoint | Method | Description |
|---|---|---|
/validate | POST | Cross-source fact verification |
/cache/query | GET | Retrieve cached trusted results |
/cache/store | POST | Store results in trust cache |
Monitoring & Analyticsโ
| Endpoint | Method | Description |
|---|---|---|
/usage | GET | API usage statistics |
/health | GET | Service health status |
/audit | GET | Request audit trail |
๐ Request Formatโ
All requests use JSON format:
Content-Type: application/json
Standard Request Structureโ
{
"query": "your search query",
"options": {
"max_results": 5,
"language": "en",
"format": "json"
},
"metadata": {
"request_id": "optional_custom_id",
"user_id": "optional_user_identifier"
}
}
๐ Response Formatโ
All responses follow a consistent structure:
{
"success": true,
"data": {
// Endpoint-specific data
},
"metadata": {
"request_id": "req_123abc",
"timestamp": "2025-01-09T10:30:00Z",
"processing_time": 1.23,
"version": "v1.0"
},
"usage": {
"requests_used": 45,
"requests_remaining": 1955
}
}
Error Response Formatโ
{
"success": false,
"error": {
"code": "INVALID_QUERY",
"message": "Query parameter is required",
"details": {
"parameter": "query",
"expected": "string (1-500 characters)",
"provided": null
}
},
"request_id": "req_error_456def"
}
๐ฆ Rate Limitsโ
Rate limits vary by plan:
| Plan | Requests/Minute | Requests/Month | Burst Limit |
|---|---|---|---|
| Free | 10 | 100 | 20 |
| Starter | 60 | 2,000 | 100 |
| Pro | 300 | 10,000 | 500 |
| Enterprise | Custom | Custom | Custom |
Rate Limit Headersโ
Responses include rate limiting information:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1640995200
X-RateLimit-Burst: 100
๐ Regions & Availabilityโ
Cortex is available in multiple regions:
| Region | Endpoint | Location |
|---|---|---|
| US East | https://us-east.api.usecortex.co/v1/ | Virginia |
| US West | https://us-west.api.usecortex.co/v1/ | California |
| Europe | https://eu.api.usecortex.co/v1/ | Ireland |
| Asia Pacific | https://ap.api.usecortex.co/v1/ | Singapore |
Use the region closest to your users for optimal performance. The main endpoint automatically routes to the nearest region.
๐ Status Codesโ
| Code | Status | Description |
|---|---|---|
200 | OK | Request successful |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Invalid or missing API key |
403 | Forbidden | Insufficient permissions |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server processing error |
502 | Bad Gateway | Temporary service issue |
503 | Service Unavailable | Maintenance mode |
๐ Search Parametersโ
Common parameters across search endpoints:
Query Parametersโ
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | required | Search query (1-500 chars) |
max_results | integer | 5 | Sources to analyze (1-20) |
language | string | "auto" | Target language code |
country | string | "global" | Geographic focus |
recency | string | "auto" | Time filter (day/week/month/year) |
Response Format Optionsโ
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | "json" | Response format (json/markdown/text) |
include_sources | boolean | true | Include source citations |
include_metadata | boolean | true | Include processing metadata |
stream | boolean | false | Enable streaming responses |
Filtering Optionsโ
{
"domain_filter": {
"include": ["reuters.com", "bloomberg.com"],
"exclude": ["example.com"]
},
"content_filter": {
"min_word_count": 100,
"max_age_days": 30,
"require_date": true
}
}
๐ Security Featuresโ
Request Validationโ
- Query sanitization - Removes potential injection attempts
- Parameter validation - Strict type and range checking
- Rate limiting - Prevents abuse and ensures fair usage
- IP filtering - Optional IP whitelisting (Enterprise)
Response Safetyโ
- Content filtering - Removes malicious or inappropriate content
- Source verification - Validates source authenticity
- Injection protection - Sanitizes all output content
- Safe rendering - Prevents XSS and code injection
๐ Monitoring & Analyticsโ
Request Trackingโ
Every request includes:
- Unique request ID for debugging
- Processing time metrics
- Source quality scores
- Cache hit/miss status
Usage Analyticsโ
Access detailed usage statistics:
- Requests per day/month
- Success/error rates
- Average response times
- Popular query patterns
๐งช Testing Environmentโ
Use our sandbox environment for development:
https://sandbox.api.usecortex.co/v1/
Features:
- Free unlimited requests
- Mock responses for consistent testing
- No rate limits during development
- Same API interface as production
๐ Versioningโ
Cortex uses URL-based versioning:
- Current:
v1(stable) - Beta:
v2-beta(preview features) - Deprecated:
v0(legacy, remove by Q3 2025)
Version headers:
API-Version: v1
Accept-Version: v1
๐ OpenAPI Specificationโ
Download our complete OpenAPI specification:
- JSON: https://api.usecortex.co/v1/openapi.json
- YAML: https://api.usecortex.co/v1/openapi.yaml
- Interactive: https://docs.usecortex.co/api-explorer
๐ Support & Resourcesโ
- Status Page: status.usecortex.co
- API Explorer: docs.usecortex.co/explorer
- Community: discord.gg/cortex
- Support: help@usecortex.co
๐ Quick Start Linksโ
- Search Endpoint โ - Real-time web search
- Extract Endpoint โ - URL content extraction
- Validate Endpoint โ - Source verification
- Error Codes โ - Complete error reference
Ready to start building? Choose an endpoint to dive deeper!