# Create API key

Tool: `veryfront__create_api_key`

Create an API key and return its secret once.

## Arguments

| Name                | Type   | Required | Description                                                                                                                                                                                              |
| ------------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`              | string | Yes      | Name for the API key                                                                                                                                                                                     |
| `project_reference` | string |          | Project ID or slug. Creating a project-scoped key requires project.api\_keys.manage. Omit for a user-level key; a project-scoped API-key caller retains its enforced project when this field is omitted. |
| `expires_at`        | string |          | Expiration date in ISO 8601 format                                                                                                                                                                       |

## Responses

| Status | Description                                           |
| ------ | ----------------------------------------------------- |
| 200    | The tool ran; its output is result.structuredContent. |

## Call it

```bash
curl -X POST -N "https://api.veryfront.com/mcp" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__create_api_key",
    "arguments": {
      "name": "string"
    }
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"id\":\"string\",\"project_id\":\"string\",\"user_id\":\"string\",\"name\":\"string\",\"key\":\"string\",\"key_prefix\":\"string\",\"expires_at\":\"string\",\"created_at\":\"string\",\"scopes\":[\"string\"],\"scope\":\"account\"}"
      }
    ],
    "structuredContent": {
      "id": "string",
      "project_id": "string",
      "user_id": "string",
      "name": "string",
      "key": "string",
      "key_prefix": "string",
      "expires_at": "string",
      "created_at": "string",
      "scopes": [
        "string"
      ],
      "scope": "account"
    }
  }
}
```
