Developer API

Quick Start

Authenticate once, create a developer API key, then call video and Ricochet endpoints with Authorization: Bearer GRIK_API_KEY.

Device login

  1. 01

    Create a device code for your app or Ricochet client.

  2. 02

    Open the verification URL and approve the displayed user code.

  3. 03

    Poll the token endpoint, then create a scoped API key.

  4. 04

    Send Authorization: Bearer GRIK_API_KEY on server-side API requests.

Create an API key

Create scoped server-side keys from an authenticated Grik account. The raw key is shown only once.

Example
curl -X POST https://grik.io/api/v1/auth/device/code \
  -H "Content-Type: application/json" \
  -d '{
    "client": "ricochet-vscode",
    "scope": "ricochet_code"
  }'

# Approve the user_code in the browser, then poll:
curl -X POST https://grik.io/api/v1/auth/device/token \
  -H "Content-Type: application/json" \
  -d '{"device_code": "DEVICE_CODE"}'

curl https://grik.io/api/v1/users/me \
  -H "Authorization: Bearer ACCESS_TOKEN"

curl -X POST https://grik.io/api/v1/auth/api-keys \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production API",
    "scopes": ["video", "ricochet_code", "social"],
    "mode": "live"
  }'

Make the first request

Send the API key as a bearer token and add Idempotency-Key on create-style requests.

Example
curl -X POST https://grik.io/api/v1/generate/video \
  -H "Authorization: Bearer GRIK_API_KEY" \
  -H "Idempotency-Key: video_job_123" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling",
    "prompt": "A cinematic product reveal on a black reflective table",
    "aspect_ratio": "16:9",
    "duration": "5s",
    "mode": "standard",
    "sound": "on"
  }'