Skip to main content

Delete an AI provider

DELETE 

/v1/projects/:project_id/ai-providers/:ai_provider_id

Deletes an AI provider configuration.

Live references — the provider project's agents, model routes whose targets name this provider, and providers whose model_aliases forward to it (meta.ai_provider_ids) — always block deletion with 409 AI_PROVIDER_HAS_DEPENDENTS; force does not override them, so delete or repoint those resources first. Soft dependents — price overrides, usage/generation records and shares another project has accepted — also block with 409 unless force=true, which deletes the provider's price overrides, revokes its shares and unlinks its usage history, preserving those rows: each usage event keeps the provider's id as its ai_provider_id. A grantee project's agents pinned to the provider fall back to that project's default route. The 409 body's error.meta reports the counts, a sample of offending IDs, and a forcible flag that is true when a force=true retry would succeed.

Request​

Responses​

AI provider deleted successfully