Skip to content
  • Auto
  • Light
  • Dark

Create

Create Anthropic API Key
models.providers.anthropic.create(AnthropicCreateParams**kwargs) -> api_key_infoAPIAnthropicAPIKeyInfoAnthropicCreateResponse
post/v2/gen-ai/anthropic/keys

To create an Anthropic API key, send a POST request to /v2/gen-ai/anthropic/keys.

Parameters
api_keystr
optional

Anthropic API key

namestr
optional

Name of the key

Returns
AnthropicCreateResponseclass

CreateAnthropicAPIKeyOutput is used to return the newly created Anthropic API key.

Hide ParametersShow Parameters
api_key_infoAPIAnthropicAPIKeyInfo
optional

Anthropic API Key Info

from gradient import Gradient

client = Gradient()
anthropic = client.models.providers.anthropic.create()
print(anthropic.api_key_info)
200 Example
{
  "api_key_info": {
    "created_at": "2023-01-01T00:00:00Z",
    "created_by": "\"12345\"",
    "deleted_at": "2023-01-01T00:00:00Z",
    "name": "\"example name\"",
    "updated_at": "2023-01-01T00:00:00Z",
    "uuid": "\"123e4567-e89b-12d3-a456-426614174000\""
  }
}