Documentation

Everything you need to build with SwiftCache. From quickstart to advanced topics.

Quickstart

1. Create an Account

Sign up at dashboard.swiftcache.io. No credit card required for the free tier.

2. Create Your First Instance

# Via Dashboard (easiest)
1. Click "Create Instance"
2. Choose name, region, and memory size
3. Copy connection string

# Available region: eu-central (Europe - Germany 🇩🇪)

3. Connect from Your App

// Node.js
import { createClient } from 'redis'

const client = createClient({
  url: process.env.SWIFTCACHE_URL
})

await client.connect()
await client.set('key', 'value')
const value = await client.get('key')

// Python
import redis

r = redis.from_url(os.environ['SWIFTCACHE_URL'])
r.set('key', 'value')
value = r.get('key')

4. Deploy to Production

Set your connection string as an environment variable and deploy. SwiftCache handles the rest.

API Reference

Authentication: All API requests require a valid Bearer token. Get your token from the dashboard after logging in.
Base URL: https://api.swiftcache.io/api/v1

GET/api/v1/instances/regions

Get available regions (public endpoint, no auth required)

Response

{
  "regions": [
    {
      "region": "eu-central",
      "regionName": "Europe (Germany)",
      "flag": "🇩🇪",
      "available": true
    }
  ]
}
POST/api/v1/instances

Create a new Redis instance (async - returns PROVISIONING status)

Request Body

{
  "organizationId": "org_abc123",
  "name": "my-cache",
  "maxMemory": 536870912,
  "region": "eu-central",
  "evictionPolicy": "allkeys-lru",
  "persistence": false
}

Response

{
  "instance": {
    "id": "inst_abc123",
    "name": "my-cache",
    "status": "PROVISIONING",
    "host": "10.0.1.5",
    "port": 6380,
    "password": "generated-password",
    "maxMemoryMb": 512,
    "region": "eu-central",
    "tier": "dedicated"
  },
  "createdDefaultKey": {
    "id": "key_xyz789",
    "name": "my-cache-default",
    "plainTextKey": "sc_live_...",
    "createdAt": "2024-01-15T10:30:00Z"
  }
}
GET/api/v1/instances?organizationId=org_abc123

List all instances for an organization

Response

{
  "instances": [
    {
      "id": "inst_abc123",
      "name": "my-cache",
      "status": "RUNNING",
      "region": "eu-central",
      "maxMemoryMb": 512,
      "tier": "dedicated",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ]
}
GET/api/v1/instances/:instanceId

Get instance details with API keys

Response

{
  "instance": {
    "id": "inst_abc123",
    "name": "my-cache",
    "status": "RUNNING",
    "host": "10.0.1.5",
    "port": 6380,
    "maxMemoryMb": 512,
    "region": "eu-central",
    "apiKeys": [
      {
        "id": "key_xyz789",
        "name": "my-cache-default",
        "createdAt": "2024-01-15T10:30:00Z",
        "lastUsed": null
      }
    ]
  }
}
PATCH/api/v1/instances/:instanceId

Update instance configuration

Request Body

{
  "name": "my-cache-updated",
  "maxMemory": 1073741824,
  "evictionPolicy": "volatile-lru"
}

Response

{
  "instance": {
    "id": "inst_abc123",
    "name": "my-cache-updated",
    "maxMemoryMb": 1024
  }
}
GET/api/v1/instances/:instanceId/metrics

Get instance metrics (last 24 hours)

Response

{
  "metrics": [
    {
      "time": "2024-01-15T10:00:00Z",
      "commands": 1500,
      "bytesIn": 524288,
      "bytesOut": 1048576,
      "hits": 1200,
      "misses": 300
    }
  ],
  "current": {
    "commands": 1500,
    "bytesIn": 524288,
    "bytesOut": 1048576,
    "hits": 1200,
    "misses": 300
  }
}
DELETE/api/v1/instances/:instanceId

Delete instance (async - returns 202 Accepted)

Response

{
  "message": "Instance deletion initiated",
  "instance": {
    "id": "inst_abc123",
    "status": "DELETING"
  }
}

Guides