Documentation
Everything you need to build with SwiftCache. From quickstart to advanced topics.
Quickstart
Get started in 5 minutes
API Reference
Complete API documentation
Guides
Best practices and tutorials
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
/api/v1/instances/regionsGet available regions (public endpoint, no auth required)
Response
{
"regions": [
{
"region": "eu-central",
"regionName": "Europe (Germany)",
"flag": "🇩🇪",
"available": true
}
]
}/api/v1/instancesCreate 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"
}
}/api/v1/instances?organizationId=org_abc123List 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"
}
]
}/api/v1/instances/:instanceIdGet 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
}
]
}
}/api/v1/instances/:instanceIdUpdate instance configuration
Request Body
{
"name": "my-cache-updated",
"maxMemory": 1073741824,
"evictionPolicy": "volatile-lru"
}Response
{
"instance": {
"id": "inst_abc123",
"name": "my-cache-updated",
"maxMemoryMb": 1024
}
}/api/v1/instances/:instanceId/metricsGet 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
}
}/api/v1/instances/:instanceIdDelete instance (async - returns 202 Accepted)
Response
{
"message": "Instance deletion initiated",
"instance": {
"id": "inst_abc123",
"status": "DELETING"
}
}Guides
Understanding Instance States
Track your instance lifecycle
- • PROVISIONING: Being created (wait 30-60s)
- • RUNNING: Ready to use
- • DELETING: Being removed
Memory Sizing
Choose the right memory for your workload
- • maxMemory in bytes (536870912 = 512MB)
- • Monitor usage via metrics API
- • Scale up with PATCH endpoint
API Keys & Authentication
Secure your Redis instances
- • Auto-generated default key
- • Bind multiple keys to instance
- • Use Bearer token for API calls
Monitoring & Metrics
Track performance and usage
- • Last 24 hours of data
- • Commands, bytes in/out
- • Cache hits and misses