taskq.xyz / docs / quickstart

Two env vars. One request. Proof headers back.

Start with a Relay call, then verify what happened. TaskQ is intentionally familiar at the edge: bearer auth, JSON body, proof headers, chain lookup. The first request touches the core loop — customer auth, BYOK handle, policy, placement, execution, HashIQ proof, and verification. That is the product.

01 · environment

Set the two values TaskQ needs.

Your TaskQ bearer identifies the customer/tenant. Your credential handle points at your customer-owned upstream provider credential. The raw provider secret is not passed in the request.

terminal — env
export TASKQ_API_KEY=tq_live_...
export TASKQ_CREDENTIAL=byok://anthropic-prod
02 · relay

Send a synchronous Relay request.

Relay is for API-shaped work: chat, completions, streaming, token counting, and model listing.

terminal — relay request · POST /v1/messages
curl https://api.taskq.xyz/v1/messages \\
  -H "authorization: Bearer $TASKQ_API_KEY" \\
  -H "x-taskq-credential: $TASKQ_CREDENTIAL" \\
  -H "x-taskq-policy: must_run_in=CA;trust_floor=audited" \\
  -d '{
    "model":"claude-opus-4-5",
    "messages":[{"role":"user","content":"Write a concise deployment checklist."}]
  }' 
03 · proof

Read the proof headers.

The response body is what your app uses. The headers are how your platform proves what happened later.

response headers — proof
HTTP/2 200
x-taskq-request-id: req_01H...
x-taskq-chain-key: hshq_184467
x-taskq-placement-proof: proof_...
x-taskq-route: verified
x-taskq-fallback-reason: none
04 · verify

Verify the HashIQ chain entry.

Lookup returns the request proof surface: policy hash, placement proof, credential fingerprint, worker reference, usage, settlement reference, and verification status.

terminal — chain lookup · GET /v1/chain/{request_id}
curl https://api.taskq.xyz/v1/chain/req_01H... \\
  -H "authorization: Bearer $TASKQ_API_KEY"
TASKQ PROOF RECEIPTVERIFIED
request_idreq_01H...
policy_hashsha256:...
placementproof_...
credential_fprsha256:...
worker_refworker_blind:...
fallback_reasonnone
verificationpassed ✓
✓ verified — what ran is what is written
05 · queue

Submit a Queue job when the work needs artifacts.

Queue is for longer-running agentic execution: reports, code patches, files, deliverables, and sealed artifact bundles.

terminal — queue submit · POST /q/submit
curl https://api.taskq.xyz/q/submit \\
  -H "authorization: Bearer $TASKQ_API_KEY" \\
  -d '{
    "credential":"byok://anthropic-prod",
    "policy":{"must_run_in":["CA"],"worker_trust_floor":"audited"},
    "task":"Review this repo and return a patch bundle.",
    "artifacts":true
  }' 
06 · failures

Common fail-closed responses.

Refusal is part of the product. When TaskQ cannot satisfy hard policy, the right answer is not fallback. The right answer is a proof-backed refusal.

409
NO_COMPLIANT_CAPACITY

No live worker satisfied the policy. A rejection proof can still be written.

422
POLICY_LOOSENING_FORBIDDEN

The request tried to weaken a customer default hard constraint.

412
CREDENTIAL_UNAVAILABLE

The credential is missing, revoked, retired, or outside the allowed key domain.

503
CAPACITY_CONTENTION

Eligible capacity existed, but the lease could not be acquired after retries.

Next doc
Authentication — bearer keys, tenants, attribution
→