Lightyear LogoLightyear Docs

Unscrambled curl

Make authenticated API calls without managing credentials locally

Unscrambled curl

unscrambled curl is a drop-in replacement for curl that automatically injects your stored credentials based on the request URL. No Bearer tokens, no API key headers, no .env files.

Basic usage

unscrambled curl https://api.github.com/user/repos

Unscrambled matches the URL domain to your stored credentials, injects the appropriate Authorization header, and returns the response. JSON responses are pretty-printed by default.

HTTP methods

Use -X to specify the HTTP method, just like curl:

# GET (default)
unscrambled curl https://api.github.com/user
 
# POST with JSON body
unscrambled curl -X POST https://api.openai.com/v1/chat/completions \
  -d '{"model": "gpt-4", "messages": [{"role": "user", "content": "Hello"}]}'
 
# PUT
unscrambled curl -X PUT https://api.hubspot.com/crm/v3/objects/contacts/123 \
  -d '{"properties": {"email": "[email protected]"}}'
 
# DELETE
unscrambled curl -X DELETE https://api.github.com/repos/owner/repo/issues/1/labels/bug
 
# PATCH
unscrambled curl -X PATCH https://api.linear.app/graphql \
  -d '{"query": "mutation { issueUpdate(id: \"abc\", input: { title: \"Updated\" }) { success } }"}'

Request headers

Add custom headers with -H:

unscrambled curl -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/user/repos

The Authorization header is injected automatically — you don't need to include it. If you do include one, it takes precedence over the stored credential.

Content-Type: application/json is added automatically when you use -d with JSON content.

Request body

Use -d for request bodies:

# JSON body
unscrambled curl -X POST https://api.openai.com/v1/embeddings \
  -d '{"model": "text-embedding-3-small", "input": "Hello world"}'
 
# From a file
unscrambled curl -X POST https://api.example.com/upload \
  -d @payload.json

Flags reference

FlagDescription
-X METHODHTTP method (GET, POST, PUT, DELETE, PATCH)
-d DATARequest body (string or @filename)
-H "Key: Value"Additional request header
--verboseShow request details including injected headers
--rawSkip credential injection (behaves like regular curl)
--service NAMEExplicitly specify which credential to use
--no-formatDisable JSON pretty-printing
--output FILEWrite response body to a file
-iInclude response headers in output

Credential matching

Unscrambled matches the URL to your stored credentials using the domain:

URL patternMatched service
api.github.com/*GitHub
api.openai.com/*OpenAI
api.hubapi.com/*HubSpot
api.notion.com/*Notion
api.stripe.com/*Stripe
api.anthropic.com/*Anthropic
api.linear.app/*Linear

If a URL doesn't match any known service, use --service to specify:

unscrambled curl --service my-api https://custom.example.com/data

Verbose mode

Use --verbose to see what Unscrambled is doing:

unscrambled curl --verbose https://api.github.com/user
→ GET https://api.github.com/user
→ Authorization: Bearer ghp_****...****  (via github)
→ Accept: application/json

← 200 OK (142ms)
← Content-Type: application/json

{
  "login": "ericbouck",
  "id": 12345,
  "name": "Eric Bouck"
}

Credentials are masked in verbose output — only the first and last 4 characters are shown.

Examples

List GitHub repositories

unscrambled curl https://api.github.com/user/repos?sort=updated&per_page=5

Send a Slack message

unscrambled curl -X POST https://slack.com/api/chat.postMessage \
  -d '{"channel": "#general", "text": "Hello from unscrambled!"}'

Create a HubSpot contact

unscrambled curl -X POST https://api.hubapi.com/crm/v3/objects/contacts \
  -d '{
    "properties": {
      "email": "[email protected]",
      "firstname": "Jane",
      "lastname": "Doe"
    }
  }'

Chat with OpenAI

unscrambled curl -X POST https://api.openai.com/v1/chat/completions \
  -d '{
    "model": "gpt-4",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Explain envelope encryption in one paragraph."}
    ]
  }'

Query Stripe payments

unscrambled curl https://api.stripe.com/v1/charges?limit=5

Search Notion

unscrambled curl -X POST https://api.notion.com/v1/search \
  -H "Notion-Version: 2022-06-28" \
  -d '{"query": "project roadmap"}'

Piping and scripting

unscrambled curl works with standard Unix pipes:

# Count your GitHub repos
unscrambled curl https://api.github.com/user/repos | jq length
 
# Save response to file
unscrambled curl https://api.github.com/user --output profile.json
 
# Use in shell scripts
REPO_COUNT=$(unscrambled curl https://api.github.com/user/repos | jq length)
echo "You have $REPO_COUNT repositories"

Request logging

Every unscrambled curl call is logged (with encrypted request/response data) for debugging. View your recent requests:

unscrambled logs
TIME                  METHOD  URL                                  STATUS  DURATION
2 minutes ago         GET     api.github.com/user/repos            200     142ms
5 minutes ago         POST    api.openai.com/v1/chat/completions   200     1.2s
10 minutes ago        GET     api.stripe.com/v1/charges            200     89ms

On this page