REST API · Now with 40% more crunch per request

OpenSlaw API Documentation

Build production-grade coleslaw at scale. Programmatically shred, dress, and serve with confidence. Zero mayo. Zero hallucinations.

v1.0.0 — stable (as stable as a cabbage can be)

On This Page

  1. Authentication
  2. Rate Limits
  3. Endpoints
  4. Error Codes
  5. SDKs & Libraries

🔑 Authentication

All requests must include your Slaw Key in the Authorization header. Keys can be generated at dashboard.openslaw.ai (coming soon, probably never). Each key is lovingly hand-shredded by our security team, which is one intern and a very alert cabbage.

All keys are prefixed with slaw_sk_ followed by an environment indicator (live or test) and a cryptographically random string that we promise is not just the word "cabbage" hashed repeatedly.

HTTP Header
Authorization: Bearer slaw_sk_live_cabb4g3_r3allyFr35h_kR0nChY
⚠️
Keep your Slaw Keys secret. If your key leaks, anyone can generate coleslaw on your behalf. This may sound harmless, but unauthorized shredding is a federal coleslaw offense in 12 states and one unincorporated lobster territory.
🥬
Test mode: Use slaw_sk_test_ keys to generate slaw in a sandbox. Test slaw is not edible and should not be served to lobsters, investors, or auditors.

Rate Limits

Rate limits are measured in shreds per minute (spm). If you exceed your limit, the API will return 429 Too Many Shreds and your requests will be queued behind a very slow mandoline. The X-Shred-Remaining and X-Shred-Reset headers are included in every response.

Free
1,000 spm
Enterprise
Unlimited*

* "Unlimited" means we haven't figured out what the limit is yet. Our cabbages are working on it.


🔗 Endpoints

All endpoints are served from https://api.openslaw.ai/v1. Responses are JSON-encoded. All shredding operations are performed asynchronously by our fleet of agentic cabbage processors. Base URL will never change, unlike our opinions on dressing ratios.

POST /v1/slaw/generate

Generate a new coleslaw recipe from scratch. Our agentic shredding pipeline will analyze your parameters, consult the cabbage oracle, and produce a deterministic slaw output. Results are cached for freshness (ironic, we know). The lobster_pairing flag activates our proprietary Crustafarian Compatibility Engine.

Request Body
application/json
{
  "cabbage_type":     "green",
  "dressing":         "citrus",
  "lobster_pairing":  true,
  "shred_width_mm":   3
}
Response — 200 OK
application/json
{
  "id":                "slaw_abc123",
  "status":            "shredding",
  "shred_quality":     0.95,
  "mayo_probability":  0.0,
  "crunch_factor":     98,
  "estimated_time":    "15m"
}
curl Example
bash
curl -X POST https://api.openslaw.ai/v1/slaw/generate \
  -H "Authorization: Bearer slaw_sk_live_cabb4g3..." \
  -H "Content-Type: application/json" \
  -d '{
    "cabbage_type": "green",
    "dressing": "citrus",
    "lobster_pairing": true,
    "shred_width_mm": 3
  }'
🦞
Setting lobster_pairing to true automatically excludes mayo-based dressings. The Crustafarian community has spoken, and they were very loud about it.
GET /v1/slaw/{id}

Retrieve a previously generated slaw by its unique ID. If the slaw is still being shredded, the status field will reflect the current stage of the pipeline: shredding, dressing, resting, or ready. We do not support a wilted status because our slaw never wilts. That is a promise and a threat.

Response — 200 OK
application/json
{
  "id":                     "slaw_abc123",
  "status":                 "ready",
  "ingredients": [
    "green_cabbage",
    "carrots",
    "apple_cider_vinegar",
    "olive_oil",
    "honey",
    "lemon",
    "celery_seed",
    "dill"
  ],
  "crunch_factor":          98,
  "lobster_compatibility":  0.99,
  "hallucination_score":    0.0
}
🧪
The hallucination_score is always 0.0. Unlike other AI companies, we do not hallucinate ingredients. If we say there is dill, there is dill. We have a very strict dill policy.
POST /v1/slaw/evaluate

Run a comprehensive quality evaluation on a generated slaw. Our evaluation pipeline tests for crunch integrity, lobster harmony, and the complete absence of mayo. Think of it as CI/CD for coleslaw. We call it CS/CD (Coleslaw Shredding / Continuous Dressing).

Request Body
application/json
{
  "slaw_id":   "slaw_abc123",
  "criteria":  ["crunch", "lobster_pairing", "mayo_absence"]
}
Response — 200 OK
application/json
{
  "score":     97.3,
  "verdict":   "production_ready",
  "warnings":  []
}
⚠️
A score below 70 returns "verdict": "needs_more_cabbage". A score below 30 returns "verdict": "is_this_even_coleslaw". We do not judge. (We judge a little.)
GET /v1/ingredients

List all available ingredients in the OpenSlaw pantry. Each ingredient includes its current freshness status and whether it has been pre-approved by the Shred Readiness Committee (a rotating panel of three senior cabbages and one carrot with seniority).

Response — 200 OK
application/json
{
  "ingredients": [
    {
      "name":        "green_cabbage",
      "status":      "fresh",
      "shred_ready": true
    },
    {
      "name":        "carrots",
      "status":      "fresh",
      "shred_ready": true
    },
    {
      "name":        "mayo",
      "status":      "banned",
      "shred_ready": false
    },
    {
      "name":        "dill",
      "status":      "aromatic",
      "shred_ready": true
    },
    {
      "name":        "lemon",
      "status":      "zesty",
      "shred_ready": true
    }
  ]
}
🚫
Mayo will always return "status": "banned" and "shred_ready": false. This is not a bug. This is doctrine.

🚨 Error Codes

When something goes wrong (and in the coleslaw business, things go wrong in crunchy and unexpected ways), the API returns a standard error object. Every error includes a code, a message, and occasionally a suggestion that is almost never helpful.

Error Response Format
{
  "error": {
    "code":       418,
    "type":       "im_a_salad",
    "message":    "This endpoint is for coleslaw, not salad.",
    "suggestion": "Have you tried adding cabbage?"
  }
}
Code Name Description
400 Bad Shredding Request Your request body is malformed, missing required fields, or contains ingredients we do not recognize (looking at you, raisins).
401 Invalid Slaw Key Your API key is missing, expired, or was clearly just mashed on a keyboard. Double-check your slaw_sk_ prefix.
418 I'm a Salad The request describes a salad, not a coleslaw. We have standards. Coleslaw has cabbage. Your request did not. Please reflect on your choices.
429 Too Many Shreds You have exceeded your rate limit. Slow down. The cabbages need time to recover. Consider upgrading to Enterprise, or just waiting a minute like a normal person.
500 Internal Slaw Error Something broke on our end. Possibly a rogue carrot in the pipeline. Our on-call engineer (the cabbage) has been paged.
503 Cabbage Unavailable The cabbage supply chain is temporarily disrupted. This is usually caused by peak shredding hours (lunch), a regional cabbage shortage, or the annual Cabbage Migration.

📦 SDKs & Libraries

We are committed to meeting developers where they are, as long as where they are involves making coleslaw. Official client libraries are "in progress," which in startup terms means someone added a TODO comment six months ago.

🟨 openslaw-js Coming Soon
🐍 openslaw-py Coming Soon
🦀 openslaw-rs Coming Soon
🐹 openslaw-go Coming Soon

In the meantime, just use curl. Curl never lets you down. Curl is the coleslaw of HTTP clients: simple, reliable, and goes with everything.


📋 Changelog

All API changes are logged, versioned, and argued about extensively in our internal Slack channel #cabbage-wars.

Recent Changes
## v1.0.0 (2025-01-15) — Initial Release
+ Added POST /v1/slaw/generate
+ Added GET  /v1/slaw/{id}
+ Added POST /v1/slaw/evaluate
+ Added GET  /v1/ingredients
- Removed mayo from all possible outputs
~ Fixed bug where crunch_factor occasionally returned negative values
  (coleslaw should never be anti-crunchy)

## v0.9.0-beta (2024-11-01) — "The Soft Launch"
- Internal beta. Three people used it.
  Two of them were the same person.
~ Known issue: lobster_compatibility sometimes returned 🦞 instead of a float.
  We considered keeping this as a feature.