Skip to main content
Welcome to the Gravix Layer API documentation. Our REST API provides programmatic access to all platform features, including AI inference, vector operations, file management, and deployment controls.

Base URL

The root endpoint for all API requests is:
https://api.gravixlayer.com/v1

Authentication

The Gravix Layer API uses API key authentication. Include your API key in the Authorization header:
Authorization: Bearer your_api_key_here

Rate Limits

API requests are subject to rate limiting:
  • Serverless: 100 requests per minute
  • Dedicated: Custom limits based on your plan
Rate limit headers are included in all responses:
  • X-RateLimit-Limit: Total requests allowed per minute
  • X-RateLimit-Remaining: Requests remaining in current window
  • X-RateLimit-Reset: Unix timestamp when the limit resets

Response Format

All API responses use JSON format with a consistent structure: Success Response
{
  "data": {
    
  },
  "meta": {
    "request_id": "req_123456789",
    "timestamp": "2025-10-13T10:30:00Z"
  }
}
Error Response
{
  "error": {
    "code": "validation_error",
    "message": "Invalid parameter",
    "details": {
      "field": "model",
      "reason": "Model not found"
    }
  },
  "meta": {
    "request_id": "req_123456789",
    "timestamp": "2025-10-13T10:30:00Z"
  }
}

HTTP Status Codes

The API uses standard HTTP status codes:
CodeDescription
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Rate Limited
500Internal Server Error

SDK Libraries

While you can use the REST API directly, we recommend using our official SDKs:
  • Python: pip install gravixlayer
  • JavaScript: Coming Soon (use OpenAI-compatible libraries with baseURL)

API Sections

Our API is organized into the following sections:

Chat Completions

Generate text using large language models

Completions

OpenAI-style prompt completions

Embeddings

Create vector embeddings from text

Files

Upload, manage, and retrieve files

Vectors

Vector database operations and search

Deployments

Manage dedicated model deployments

Vision

Image analysis and vision models

Getting Started

  1. Get your API key from the dashboard
  2. Make your first request using curl:
     curl -X POST https://api.gravixlayer.com/v1/chat/completions \
       -H "Authorization: Bearer your_api_key_here" \
       -H "Content-Type: application/json" \
       -d @- << 'EOF'
     {
       "model": "meta-llama/llama-3.1-8b-instruct",
       "messages": [{"role": "user", "content": "Hello, world!"}]
     }
     EOF
    
  3. Explore the endpoints in this documentation
  4. Build your application using our SDKs or direct API calls

Support

I