---
title: Een API-sleutel bijwerken | RunAPI
description: Werk een bestaande standaard API-sleutel bij en haal de huidige gebruikssamenvatting
  op.
url: https://runapi.ai/nl/docs/api/management/keys/update.md
canonical: https://runapi.ai/nl/docs/api/management/keys/update
locale: nl
---

> HTML-versie: https://runapi.ai/nl/docs/api/management/keys/update
> Site-index voor agents: https://runapi.ai/llms.txt

# Een API-sleutel bijwerken

Werk een bestaande standaard API-sleutel bij en haal de huidige gebruikssamenvatting op.

## Eindpunt

PATCH /api/v1/keys/:id

Basis-URL: https://runapi.ai

API-versie: v1

Authenticatie: Authorization: Bearer YOUR_MANAGEMENT_API_KEY


Autorisatie: Vereist een Management API-sleutel met accountbeheerdersrechten en staat alleen sleutels toe die eigendom zijn van de bijbehorende gebruiker.

## Verzoek

Stuur waarden alleen op de vermelde verzoeklocatie.

### JSON-body

```json
{
  "allowed_models": {
    "description": "Vervangende toegestane modellenlijst; null of een lege array wist de lijst.",
    "required": false,
    "type": "array | null"
  },
  "credit_limit_cents": {
    "description": "Uitgavenplafond in USD-centen; null wist het plafond en het resetinterval.",
    "required": false,
    "type": "integer | null"
  },
  "credit_limit_reset_interval": {
    "description": "Herstellingscyclus voor het bestedingsplafond.",
    "enum": [
      "daily",
      "weekly",
      "monthly"
    ],
    "required": false,
    "type": "string | null"
  },
  "credit_limit_windows": {
    "description": "Vervangende doorlopende bestedingslimieten gekoppeld aan 1h, 1d of 7d; een leeg object wist alle doorlopende limieten.",
    "required": false,
    "type": "object"
  },
  "enabled": {
    "description": "Of verzoeken met deze sleutel worden geaccepteerd.",
    "required": false,
    "type": "boolean"
  },
  "name": {
    "description": "Vervangende gebruiksvriendelijke naam voor de API-sleutel.",
    "required": false,
    "type": "string"
  }
}
```

### Padparameters

```json
{
  "id": {
    "description": "Prefix-ID van de API-sleutel, bijvoorbeeld token_123.",
    "required": true,
    "type": "string"
  }
}
```

## Succesvol antwoord

HTTP 200 - PATCH /api/v1/keys/:id

```json
{
  "allowed_models": [
    "gpt-5.4"
  ],
  "created_at": "2026-07-27T10:00:00.000Z",
  "credit_limit_cents": 1000,
  "credit_limit_reset_interval": "daily",
  "credit_limit_windows": {},
  "credit_usage_cents_by_model": {
    "gpt-5.4": 250
  },
  "credit_usage_cents_this_month": 250,
  "credit_usage_cents_this_week": 100,
  "credit_usage_cents_today": 25,
  "credit_usage_cents_total": 250,
  "enabled": true,
  "guardrail_id": "guardrail_123",
  "id": "token_123",
  "last_used_at": null,
  "masked_token": "runapi_abc...wxyz",
  "name": "Production primary"
}
```

## Foutrespons (401)

HTTP 401

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

```json
{
  "error": "Authentication required"
}
```

## Foutrespons (403)

HTTP 403

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

```json
{
  "error": "Management API key required"
}
```

## Foutrespons (403)

HTTP 403

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

```json
{
  "error": "Account admin required"
}
```

## Foutrespons (400)

HTTP 400

### Responsschema

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Leesbare foutmelding.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Leesbare validatiesamenvatting.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Validatieberichten gekoppeld aan het openbare aanvraagveld, met een reeks leesbare tekenreeksen per veld.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### Responsvoorbeeld

```json
{
  "error": "page must be an integer"
}
```

## Foutrespons (404)

HTTP 404

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

```json
{
  "error": "Resource not found"
}
```

## Foutrespons (422)

HTTP 422

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare validatiesamenvatting.",
      "type": "string"
    },
    "errors": {
      "additionalProperties": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "description": "Validatieberichten gekoppeld aan het openbare aanvraagveld, met een reeks leesbare tekenreeksen per veld.",
      "type": "object"
    }
  },
  "required": [
    "error",
    "errors"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

```json
{
  "error": "Validation failed",
  "errors": {
    "base": [
      "Validation failed"
    ]
  }
}
```

## cURL-voorbeeld



### curl

```curl
curl -X PATCH https://runapi.ai/api/v1/keys/token_123 \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Production primary","enabled":true,"credit_limit_windows":{}}'
```

## Gerelateerde referentie

- [API-sleutels](https://runapi.ai/nl/docs/api/management/keys.md)
- [API-sleutelobject](https://runapi.ai/nl/docs/api/management/keys/object.md)

---

## Meer van RunAPI

- [Home](https://runapi.ai/nl/.md)
- [Modelcatalogus](https://runapi.ai/nl/models.md)
- [Prijzen](https://runapi.ai/nl/pricing.md)
- [Providers](https://runapi.ai/nl/models)
- [Documentatie](https://runapi.ai/nl/docs/guides)
- [SDK's](https://runapi.ai/nl/sdk.md)
- [CLI](https://runapi.ai/nl/cli.md)
- [MCP Server](https://runapi.ai/nl/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/nl/claude-code-vs-cursor.md)
- [Cursor API instellen](https://runapi.ai/nl/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/nl/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/nl/contact.md)
- [Contact](https://runapi.ai/nl/contact.md)
- [Voorwaarden](https://runapi.ai/nl/terms.md)
- [Privacy](https://runapi.ai/nl/privacy.md)
- [Site-index voor agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Gestructureerde gegevens

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/nl",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/nl/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/nl",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/nlicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "TechArticle",
    "headline": "Een API-sleutel bijwerken",
    "description": "Werk een bestaande standaard API-sleutel bij en haal de huidige gebruikssamenvatting op.",
    "url": "https://runapi.ai/nl/docs/api/management/keys/update",
    "mainEntityOfPage": "https://runapi.ai/nl/docs/api/management/keys/update"
  }
]
```
