API Reference

The Nubis API allows you to programmatically manage your infrastructure using standard HTTP requests.

Base URL

https://api.usenubis.com/v1

Authentication

All API requests require authentication using an API token. Include your token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN

Rate Limiting

API requests are limited to 1000 requests per hour per API token. Rate limit information is included in response headers:

  • X-RateLimit-Limit: Maximum requests per hour
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Time when limit resets

Example Request

Here's an example of creating a compute instance:

curl -X POST https://api.usenubis.com/v1/compute/instances \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-instance",
    "size": "medium",
    "region": "us-east",
    "image": "ubuntu-22.04"
  }'

Response Format

All API responses are returned in JSON format:

{
  "id": "inst_abc123",
  "name": "my-instance",
  "status": "running",
  "size": "medium",
  "region": "us-east",
  "ip_address": "192.0.2.1",
  "created_at": "2024-01-15T10:30:00Z"
}

Error Handling

Errors are returned with appropriate HTTP status codes and error messages:

{
  "error": {
    "code": "invalid_request",
    "message": "The 'size' parameter is required",
    "param": "size"
  }
}

API Endpoints

Explore detailed documentation for each endpoint: