---
site: steel.dev
collection: docs
canonical_url: https://steel.dev/docs/reference/api/api-keys
markdown_url: https://steel.dev/docs/reference/api/api-keys.md
content_signal: ai-input=yes, ai-train=yes, search=yes
title: API keys API
description: Create a project key through the Steel API with an organization key, so that each app or environment gets its own key.
summary: Create a project key through the Steel API with an organization key, so that each app or environment gets its own key.
type: reference
reviewed: 2026-11-12
prerequisites: []
related:
  - https://steel.dev/docs/reference/api/profiles.md
  - https://steel.dev/docs/reference/api/credentials.md
  - https://steel.dev/docs/reference/api/files.md
  - https://steel.dev/docs/reference/api/extensions.md
  - https://steel.dev/docs/reference/api/projects.md
agent_setup: https://setup.steel.dev/install.md
docs_index: https://steel.dev/docs/sitemap.md
---

# API keys API

An API key authenticates your requests to Steel. This endpoint creates a project key, which works in one project only. For the base URL and authentication, see [API conventions](https://steel.dev/docs/reference/api). For the error codes, see [Errors](https://steel.dev/docs/reference/errors).

## Endpoints

### Create an API key

```http
POST /v1/api-keys
```

Creates a project key. Authenticate with an organization key, which works across the organization.

A project key cannot create keys, and an organization key cannot create another organization key. The new key does not depend on the key that created it. When you revoke the organization key, the project key keeps working.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `projectId` | body | string (uuid) | yes | | The project to bind the key to. It must be an active project of your organization. |
| `name` | body | string | no | `Default` | A label for the key. |
| `scopeType` | body | string | no | `project` | Must be `project` or left out. |

The response is `201`:

| Field | Type | Description |
| - | - | - |
| `id` | string (uuid) | The ID of the key. |
| `key` | string | The full secret of the key. |
| `name` | string | The label of the key. |
| `projectId` | string (uuid) or null | The key's project. |
| `scopeType` | string | Always `project`. |
| `createdAt` | string (date-time) | When the key was created. |
| `updatedAt` | string (date-time) | When the key last changed. |

> **Warning**
>
> The response is the only time that Steel shows the full secret in `key`. Save it in a secret store before you do anything else.

Without `projectId`, the response is `400`. A project key gets `403`. When the project is not active or not in your organization, the response is `404`.

In these examples, `STEEL_API_KEY` holds an organization key, and `STEEL_PROJECT_ID` holds the ID of the project. [Projects](https://steel.dev/docs/account/projects) shows how to find the ID.

**cURL**

```sh
curl -X POST https://api.steel.dev/v1/api-keys \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"projectId\": \"$STEEL_PROJECT_ID\", \"name\": \"ci\"}"
```

**TypeScript**

```ts file=create-key.mts
import Steel from "steel-sdk";

const client = new Steel();
const apiKey = await client.apiKeys.create({
  projectId: process.env.STEEL_PROJECT_ID,
  name: "ci",
});

console.log(apiKey.id, apiKey.projectId);
```

**Python**

```python file=create-key.py
import os

from steel import Steel

client = Steel()
api_key = client.api_keys.create(
    project_id=os.environ["STEEL_PROJECT_ID"],
    name="ci",
)

print(api_key.id, api_key.project_id)
```

**Go**

```go file=main.go
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/steel-dev/sdk/go"
)

func main() {
	if err := run(context.Background()); err != nil {
		log.Fatal(err)
	}
}

func run(ctx context.Context) error {
	client := steel.NewClient()
	apiKey, err := client.APIKeys.New(ctx, steel.APIKeyNewParams{
		ProjectID: steel.F(os.Getenv("STEEL_PROJECT_ID")),
		Name:      steel.F("ci"),
	})
	if err != nil {
		return err
	}

	fmt.Println(apiKey.ID, apiKey.ProjectID)
	return nil
}
```

**Rust**

```rust file=src/main.rs
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = steel_rs::Client::new();
    let api_key = client
        .api_keys()
        .create(steel_rs::ApiKeyCreateParams {
            project_id: Some(std::env::var("STEEL_PROJECT_ID")?),
            name: Some("ci".to_owned()),
            ..Default::default()
        })
        .await?;

    let project_id = api_key.project_id.unwrap_or_default();
    println!("{} {project_id}", api_key.id);
    Ok(())
}
```

See [API keys](https://steel.dev/docs/account/api-keys).
