MCPcopy Index your code
hub / github.com/coder/coder / GetAIProviderKeysByProviderID

Method GetAIProviderKeysByProviderID

coderd/database/querier.go:289–289  ·  view source on GitHub ↗

Returns all keys for a provider, ordered by created_at ASC so the oldest key is returned first. AI Bridge currently uses the oldest key per provider; multiple keys are stored to support future failover and rotation flows.

(ctx context.Context, providerID uuid.UUID)

Source from the content-addressed store, hash-verified

287 // key per provider; multiple keys are stored to support future
288 // failover and rotation flows.
289 GetAIProviderKeysByProviderID(ctx context.Context, providerID uuid.UUID) ([]AIProviderKey, error)
290 // Returns all keys for the requested providers, ordered by provider then created_at ASC
291 // so callers can select the oldest non-empty key per provider without issuing N queries.
292 GetAIProviderKeysByProviderIDs(ctx context.Context, providerIds []uuid.UUID) ([]AIProviderKey, error)

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls