---
title: "Store LLM Provider's ApiKey"
method: POST
path: "/v1/private/llm-provider-key"
tags: ["LlmProviderKey"]
---

# Store LLM Provider's ApiKey

`POST /v1/private/llm-provider-key`

Store LLM Provider's ApiKey

## Request body

- ProviderApiKeyWrite
  - `provider` 'openai' | 'anthropic' | 'gemini' | 'openrouter' | 'vertex-ai' | 'bedrock' | 'ollama' | 'custom-llm' | 'opik-free', required
  - `api_key` string
  - `name` string
  - `provider_name` string — Provider name - required for custom LLM and Bedrock providers to uniquely identify them (e.g., 'ollama', 'vllm', 'Bedrock us-east-1'). Must not be blank for custom and Bedrock providers. Should not be set for standard providers (OpenAI, Anthropic, etc.). This requirement is conditional and validation is enforced programmatically.
  - `headers` object
  - `configuration` object
  - `base_url` string

## Response `201`

Created

## Other responses

- `401` — Bad Request
- `403` — Access forbidden

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/versions/4ed2fbc97cc3/schema)
