Create a project key

Workspace keys (sk_wsp_…) cannot run jobs. Use one to create a project and mint a project service-account key (sk_prj_…). Later calls use that project key. Pick cURL, Python, or Node.js — every snippet on this page follows that language.

1. Get a workspace key

In the dashboard, open Workspace → Workspace keys. Create a key with project:create and project_api_key:create (omit permissions to grant the full workspace set). Copy the secret once — it is not shown again.

Workspace keys are service-account credentials. API writes are attributed to that service account, not to the human who minted the key. They cannot sign in to the console.

2. Confirm the workspace key

GET /v1/workspace returns the workspace bound to the key. A 401 means the secret is wrong or revoked.

GET /v1/workspace
curl "{BASE_URL}/v1/workspace" \
  -H "Authorization: Bearer {WORKSPACE_KEY}"

3. Create a project

POST /v1/projects — save data.projectId (prj_…).

POST /v1/projects
curl -X POST "{BASE_URL}/v1/projects" \
  -H "Authorization: Bearer {WORKSPACE_KEY}" \
  -H "Content-Type: application/json" \
-d '{
    "name": "{PROJECT_NAME}",
    "description": "Partner project"
  }'

4. Mint a project API key

POST /v1/project-api-keys creates a service-account user and one key. Send serviceAccountName (the identity that owns later API writes). Optional name is a key label; omit permissions to grant all project scopes (canvases, services, jobs, storage, transcripts).

Store data.secret immediately. See Project API keys.

POST /v1/project-api-keys
curl -X POST "{BASE_URL}/v1/project-api-keys" \
  -H "Authorization: Bearer {WORKSPACE_KEY}" \
  -H "Content-Type: application/json" \
-d '{
    "projectId": "{PROJECT_ID}",
    "serviceAccountName": "{SERVICE_ACCOUNT_NAME}"
  }'

Run the script

Replace the {…} placeholders and run the three calls in order. Copy projectId from step 2 into step 3.

Create project + project key
# 1. Confirm the workspace key
curl "{BASE_URL}/v1/workspace" \
  -H "Authorization: Bearer {WORKSPACE_KEY}"

# 2. Create a project — copy data.projectId
curl -X POST "{BASE_URL}/v1/projects" \
  -H "Authorization: Bearer {WORKSPACE_KEY}" \
  -H "Content-Type: application/json" \
-d '{"name": "{PROJECT_NAME}"}'

# 3. Mint a project key — copy data.secret (shown once)
curl -X POST "{BASE_URL}/v1/project-api-keys" \
  -H "Authorization: Bearer {WORKSPACE_KEY}" \
  -H "Content-Type: application/json" \
-d '{
    "projectId": "{PROJECT_ID}",
    "serviceAccountName": "{SERVICE_ACCOUNT_NAME}"
  }'