---
title: "Create API Key"
method: POST
path: "/v1/accounts/{account_id}/users/{user_id}/apiKeys"
tags: ["gateway.openapi_Gateway"]
---

# Create API Key

`POST /v1/accounts/{account_id}/users/{user_id}/apiKeys`

## Request

- Base URL: `https://api.fireworks.ai`
- URL: `https://api.fireworks.ai/v1/accounts/{account_id}/users/{user_id}/apiKeys`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/fw-ai-external/apis/gateway-rest-api/docs/v1/accounts/:account_id/users/:user_id/apiKeys/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `account_id` string, required
- `user_id` string, required

## Request body

- GatewayGatewayCreateApiKeyBody
  - `apiKey` GatewayApiKey, required
    - `keyId` string: Unique identifier (Key ID) for the API key, used primarily for deletion.
    - `displayName` string: Display name for the API key, defaults to "default" if not specified.
    - `key` string: The actual API key value, only available upon creation and not stored thereafter.
    - `createTime` string, date-time: Timestamp indicating when the API key was created.
    - `secure` boolean: Indicates whether the plaintext value of the API key is unknown to Fireworks. If true, Fireworks does not know this API key's plaintext value. If false, Fireworks does know the plaintext value.
    - `email` string: Email of the user who owns this API key.
    - `prefix` string
    - `expireTime` string, date-time: Timestamp indicating when the API key will expire. If not set, the key never expires.
    - `annotations` object: Optional key-value annotations for this API key.
    - `lastUsed` string, date-time: Timestamp indicating when the API key was last used. Not set if the key has never been used.
    - `isFirepass` boolean: True when this key is a FirePass inference key.

## Response `200`

A successful response.

- GatewayApiKey
  - `keyId` string: Unique identifier (Key ID) for the API key, used primarily for deletion.
  - `displayName` string: Display name for the API key, defaults to "default" if not specified.
  - `key` string: The actual API key value, only available upon creation and not stored thereafter.
  - `createTime` string, date-time: Timestamp indicating when the API key was created.
  - `secure` boolean: Indicates whether the plaintext value of the API key is unknown to Fireworks. If true, Fireworks does not know this API key's plaintext value. If false, Fireworks does know the plaintext value.
  - `email` string: Email of the user who owns this API key.
  - `prefix` string
  - `expireTime` string, date-time: Timestamp indicating when the API key will expire. If not set, the key never expires.
  - `annotations` object: Optional key-value annotations for this API key.
  - `lastUsed` string, date-time: Timestamp indicating when the API key was last used. Not set if the key has never been used.
  - `isFirepass` boolean: True when this key is a FirePass inference key.

## Changes

- **2026-10-16** `3bf245180173`: 5 info
  - added the new optional request property `apiKey/annotations`
  - added the new optional request property `apiKey/isFirepass`
  - added the optional property `annotations` to the response with the `200` status
  - added the optional property `isFirepass` to the response with the `200` status
  - …1 more
- **2025-11-06** `311efdb2fa57`: 3 info
  - the endpoint scheme security `BearerAuth` was added to the API
  - api tag `gateway.openapi_Gateway` added
  - api tag `Gateway` removed

[Operation history](https://skmtc.dev/fw-ai-external/apis/gateway-rest-api/changes/v1/accounts/:account_id/users/:user_id/apiKeys/post.md)

---

[API](https://skmtc.dev/fw-ai-external/apis/gateway-rest-api.md) - [All operations](https://skmtc.dev/fw-ai-external/apis/gateway-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fw-ai-external/apis/gateway-rest-api/revisions/3bf245180173?raw)
