Providers

Create a key for a provider

POST/api/providers/{provider}/keys

Creates a new API key for the specified provider. The key id is auto-generated if omitted. enabled defaults to true if omitted. value is required and must not be empty. Keys cannot be created on keyless providers.

Path Parameters

provider*string

Provider name

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:8080/api/providers/string/keys" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "name": "string",
  "value": {
    "value": "string",
    "env_var": "string",
    "from_env": true
  },
  "models": [
    "string"
  ],
  "blacklisted_models": [
    "string"
  ],
  "weight": 0,
  "azure_key_config": {
    "endpoint": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "deployments": {
      "property1": "string",
      "property2": "string"
    },
    "api_version": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "client_id": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "client_secret": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "tenant_id": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "scopes": [
      "string"
    ]
  },
  "vertex_key_config": {
    "project_id": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "project_number": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "region": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "auth_credentials": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "deployments": {
      "property1": "string",
      "property2": "string"
    }
  },
  "bedrock_key_config": {
    "access_key": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "secret_key": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "session_token": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "region": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "arn": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "deployments": {
      "property1": "string",
      "property2": "string"
    },
    "batch_s3_config": {
      "buckets": [
        {
          "bucket_name": "string",
          "prefix": "string",
          "is_default": true
        }
      ]
    }
  },
  "replicate_key_config": {
    "deployments": {
      "property1": "string",
      "property2": "string"
    }
  },
  "vllm_key_config": {
    "url": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    },
    "model_name": "string"
  },
  "ollama_key_config": {
    "url": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    }
  },
  "sgl_key_config": {
    "url": {
      "value": "string",
      "env_var": "string",
      "from_env": true
    }
  },
  "enabled": true,
  "use_for_batch_api": true,
  "config_hash": "string",
  "status": "string",
  "description": "string"
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}