Key Request
Overview
Section titled “Overview”Users without an API key can submit an access request via this public endpoint. Submissions are queued for operator review. By default, keys are not issued automatically — an operator must approve each request and provision the key manually.
Endpoint: POST /access/request-key
Authentication: None
Request Body
Section titled “Request Body”{ "email": "user@example.com", "use_case": "Building a customer support chatbot for an e-commerce store."}Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Contact email for the requester |
use_case | string | Yes | Brief description of how the API will be used |
Response
Section titled “Response”A successful submission returns HTTP 202 Accepted with a request_id you can reference when following up.
{ "request_id": "kreq_01j9xkz3p4q5r6s7t8u9v0w1", "status": "pending", "message": "Your request has been received. An operator will review it and reach out to you at user@example.com."}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
request_id | string | Unique identifier for this access request |
status | string | Always "pending" at submission time |
message | string | Human-readable confirmation |
Key Issuance Flow
Section titled “Key Issuance Flow”- User submits
POST /access/request-keywith email and use case. - The gateway stores the request and returns a
request_id. - An operator reviews the submission out-of-band.
- If approved, the operator provisions a Bearer token and delivers it to the requester’s email.
There is no polling endpoint — the operator contacts the requester directly once the key is ready.
Examples
Section titled “Examples”curl -X POST https://your-gateway.workers.dev/access/request-key \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "use_case": "Building a customer support chatbot for an e-commerce store." }'const response = await fetch('https://your-gateway.workers.dev/access/request-key', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ email: 'user@example.com', use_case: 'Building a customer support chatbot for an e-commerce store.', }),});
if (response.status === 202) { const data = await response.json(); console.log(`Request submitted. ID: ${data.request_id}`); console.log(data.message);} else { const error = await response.json(); console.error(`Submission failed: ${error.error.message}`);}Error Responses
Section titled “Error Responses”| Status | Description |
|---|---|
400 | Missing or invalid email / use_case field |
429 | Too many requests from this IP — try again later |