# ApiKeyCredential

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/auth_store/ApiKeyCredential)

A persisted API key credential.

The `type` field is the discriminator that lets `OAuthCredential` (added
later) coexist in the same file without migration.

## Signature

```python
ApiKeyCredential()
```

## Extends

- `TypedDict`

## Constructors

```python
__init__(
    type: Literal['api_key'],
    key: str,
    added_at: str,
    base_url: NotRequired[str],
)
```

| Name | Type |
|------|------|
| `type` | `Literal['api_key']` |
| `key` | `str` |
| `added_at` | `str` |
| `base_url` | `NotRequired[str]` |


## Properties

- `type`
- `key`
- `added_at`
- `base_url`

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a98f0dfa8d534d8a1885b524632400e52db22ac6/libs/code/deepagents_code/auth_store.py#L43)