---
title: "Connect a provider API key for a customer (admin only)"
method: POST
path: "/v1/admin/customer/{customerId}/ai-spend/connection"
tags: ["AiSpend"]
---

# Connect a provider API key for a customer (admin only)

`POST /v1/admin/customer/{customerId}/ai-spend/connection`

## Path parameters

- `customerId` string, required

## Request body

- object
  - `provider` union, required
    - 'anthropic'
    - 'openai'
  - `apiKey` string, required

## Response `200`

Default Response

- object
  - `id` string, required
  - `customerId` string, required
  - `provider` union, required
    - 'anthropic'
    - 'openai'
  - `providerOrgId` string, nullable, required
  - `keyPreview` string, nullable, required
  - `createdBy` string, nullable, required
  - `connectedAt` string, date-time, required
  - `lastSyncAt` string, date-time, nullable, required
  - `lastSyncStatus` string, nullable, required
  - `lastSyncError` string, nullable, required
  - `disconnectedAt` string, date-time, nullable, required
  - `updatedAt` string, date-time, required

## Other responses

- `400` — Default Response
- `401` — The access to this resource has been denied
- `403` — The access to this resource is forbidden
- `409` — Default Response
- `422` — Default Response
- `502` — Default Response
- `default` — Catch-all error response for any unexpected internal errors

---

[API](https://skmtc.net/funneldash/apis/surface-admin-api.md) · [All operations](https://skmtc.net/funneldash/apis/surface-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/funneldash/surface-admin-api/versions/0dc20381c4a7/schema)
