Implementation:Helicone Helicone Provider Key Types
| Knowledge Sources | |
|---|---|
| Domains | Provider Management, Type System |
| Last Updated | 2026-02-14 06:32 GMT |
Overview
TypeScript type definitions for LLM provider configuration, API key management, and provider sorting, forming the type foundation for the provider vault system.
Description
This module defines the core type interfaces used throughout the provider key management system in Helicone. It contains four main interfaces and one type alias:
Provider Interface: Represents an LLM provider's metadata and configuration requirements. Includes the provider identifier (from ModelProviderName), display name, logo URL, description, documentation URL, API key label and placeholder text, a relevance score for sorting, optional notes, multi-key allowance flag, authentication type (api-key, oauth, aws-signature, or service_account), and public visibility flag.
ProviderConfiguration Interface: Represents a stored provider configuration from the API, including the configuration ID, provider name, configuration object, timestamps, and associated provider keys.
ProviderKey Interface: Represents a stored provider API key with the key ID, provider name (typed as ModelProviderName), display name, creation timestamp, soft delete flag, optional JSON config for provider-specific settings, optional CUID, and a BYOK (Bring Your Own Key) enabled flag for AI Gateway integration.
DecryptedProviderKey Interface: Represents a fully decrypted provider key with organization context, containing nullable fields for ID, organization ID, decrypted key value, provider name, and key display name.
SortOption Type: A union type for provider list sorting: "relevance", "alphabetical", or "recently-used".
Usage
Import these types when working with provider key management UIs, vault components, API client interfaces, or any code that handles LLM provider configuration and key storage.
Code Reference
Source Location
- Repository: Helicone
- File: web/types/provider.ts
Signature
export interface Provider {
id: ModelProviderName;
name: string;
logoUrl: string;
description: string;
docsUrl: string;
apiKeyLabel: string;
apiKeyPlaceholder: string;
relevanceScore: number;
note?: string;
multipleAllowed?: boolean;
auth?: "api-key" | "oauth" | "aws-signature" | "service_account";
publiclyVisible?: boolean;
}
export interface ProviderConfiguration {
id: string;
provider_name: string;
provider_configuration: Record<string, any>;
created_at: string;
updated_at: string;
provider_keys?: ProviderKey[];
}
export interface ProviderKey {
id: string;
provider_name: ModelProviderName;
provider_key_name: string;
created_at?: string;
soft_delete: boolean;
config?: Record<string, any>;
cuid?: string | null;
byok_enabled?: boolean;
}
export interface DecryptedProviderKey {
id: string | null;
org_id: string | null;
provider_key: string | null;
provider_name: string | null;
provider_key_name: string | null;
}
export type SortOption = "relevance" | "alphabetical" | "recently-used";
Import
import {
Provider,
ProviderConfiguration,
ProviderKey,
DecryptedProviderKey,
SortOption,
} from "@/types/provider";
I/O Contract
Provider Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | ModelProviderName |
Yes | Unique provider identifier from the cost package |
| name | string |
Yes | Human-readable provider name |
| logoUrl | string |
Yes | URL to the provider's logo image |
| description | string |
Yes | Brief provider description |
| docsUrl | string |
Yes | Link to provider documentation |
| apiKeyLabel | string |
Yes | Label for the API key input field |
| apiKeyPlaceholder | string |
Yes | Placeholder text for the API key input |
| relevanceScore | number |
Yes | Hidden score for default sorting order |
| note | string |
No | Optional informational note |
| multipleAllowed | boolean |
No | Whether multiple keys can be stored |
| auth | "oauth" | "aws-signature" | "service_account" | No | Authentication mechanism type |
| publiclyVisible | boolean |
No | Whether the provider is visible to all users |
ProviderKey Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string |
Yes | Unique key identifier |
| provider_name | ModelProviderName |
Yes | Associated provider |
| provider_key_name | string |
Yes | User-defined display name for the key |
| created_at | string |
No | ISO timestamp of creation |
| soft_delete | boolean |
Yes | Whether the key has been soft-deleted |
| config | Record<string, any> |
No | Provider-specific configuration |
| cuid | null | No | Compact unique identifier |
| byok_enabled | boolean |
No | Whether the key is enabled for AI Gateway BYOK |
Authentication Types
| Type | Description |
|---|---|
| api-key | Standard API key authentication |
| oauth | OAuth 2.0 flow |
| aws-signature | AWS Signature V4 authentication (for Bedrock) |
| service_account | Service account credentials (for Google Vertex AI) |
Usage Examples
import { Provider, ProviderKey, SortOption } from "@/types/provider";
const openaiProvider: Provider = {
id: "openai",
name: "OpenAI",
logoUrl: "/providers/openai.svg",
description: "GPT-4, GPT-3.5, and other OpenAI models",
docsUrl: "https://docs.helicone.ai/providers/openai",
apiKeyLabel: "API Key",
apiKeyPlaceholder: "sk-...",
relevanceScore: 100,
auth: "api-key",
publiclyVisible: true,
};
// Sorting providers
const sortBy: SortOption = "relevance";
const sorted = providers.sort((a, b) =>
sortBy === "relevance"
? b.relevanceScore - a.relevanceScore
: a.name.localeCompare(b.name)
);