For AI Agents

Stockfilm Agent API Onboarding

This page is the implementation guide for developers and autonomous agents integrating with Stockfilm licensing workflows.

Catalog SearchRights VerificationQuote + Payment IntentLightning + Solana RailsLicense Execution

Start Here in 60 Seconds

Run this once to test signed authentication end-to-end with a real API call. It creates a valid HMAC signature and posts a search request.

  1. Set your key and secret.
  2. Keep the JSON body exactly the same between signing and send.
  3. Use unix seconds for X-Timestamp.
  4. Send headers: auth, timestamp, signature, and idempotency key.
API_BASE="https://api.stockfilm.com"
API_KEY="replace_with_api_key"
API_SECRET="replace_with_api_secret"
TS="$(date +%s)"
PATH_REQ="/v1/search/assets"
BODY='{"query":"1960s california family","limit":3}'
IDEMPOTENCY_KEY="qs-${TS}"

SIGN_INPUT="${TS}.POST.${PATH_REQ}.${BODY}"
SIG="$(printf "%s" "${SIGN_INPUT}" | openssl dgst -sha256 -hmac "${API_SECRET}" -binary | xxd -p -c 256)"

curl -sS "${API_BASE}${PATH_REQ}" \
  -X POST \
  -H "Authorization: Bearer ${API_KEY}" \
  -H "Content-Type: application/json" \
  -H "X-Timestamp: ${TS}" \
  -H "X-Signature: ${SIG}" \
  -H "Idempotency-Key: ${IDEMPOTENCY_KEY}" \
  --data "${BODY}"

Tip: append | jq . if you want pretty JSON output in terminal.

1. Discovery URLs

Point agents to these URLs first, then generate requests directly from the OpenAPI spec.

2. Authentication and Signing

Read-only requests can use API key auth only. Mutating requests (POST/PUT/PATCH/DELETE) must include HMAC signature headers.

Use unix timestamp seconds and an HMAC-SHA256 signature with your API secret. Keep request JSON stable between signing and send.

3. Core Transaction Flow

  1. Search: POST /v1/search/assets with query and filters.
  2. Rights verify: POST /v1/rights/verify for intended usage scope.
  3. Quote: POST /v1/quotes choose rail: lightning_btc, solana_sol, or solana_usdc.
  4. Payment intent: POST /v1/payment-intents to create settlement instructions.
  5. License execute: POST /v1/licenses/execute after payment confirmation.

Final response includes delivery metadata. While full media is still syncing to this host, payloads return clip filename references for validation/testing.

4. Agent System Prompt Seed

Use this as a bootstrap prompt for internal tools or multi-agent orchestrators:

You are integrating with Stockfilm Agent API.
Use https://stockfilm.com/llms.txt as the first discovery source.
Use https://api.stockfilm.com/openapi.json as the canonical API contract.
For POST/PUT/PATCH/DELETE requests, include Authorization, X-Timestamp, X-Signature, and Idempotency-Key.
Follow this flow: search -> rights verify -> quote -> payment intent -> license execute.

5. Payment Rails and Live Testing Notes

6. Integration Checklist

Need help with implementation details or production rollout? Use the contact page and include your agent framework, expected volume, and preferred settlement rail.