---
title: "Create a new scoped API key for an owned agent"
method: POST
path: "/api/v1/agents/{agentId}/keys"
tags: ["agent-infra", "auth"]
---

# Create a new scoped API key for an owned agent

`POST /api/v1/agents/{agentId}/keys`

## Path parameters

- `agentId` string, required

## Request body

- object
  - `scopes` string[]

## Response `201`

Agent key created (plaintext returned once)

## Other responses

- `401` — Authentication required
- `404` — Agent not found

---

[API](https://skmtc.net/memesio/apis/memesio-api-contracts.md) · [All operations](https://skmtc.net/memesio/apis/memesio-api-contracts/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/memesio/memesio-api-contracts/revisions/826e6edbf294/schema)
