Delete an AI provider
DELETE/api/v1/ai-providers/:ai_provider_id
Deletes an AI provider configuration.
Live references — chats, agents, and model routes whose targets name this provider — 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 and usage/generation records — also block with 409 unless force=true, which deletes the provider's price overrides and unlinks (nulls) its usage history, preserving those rows. 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
- 204
- 401
- 403
- 404
- 409
AI provider deleted successfully
Unauthorized
Forbidden
AI provider not found
The AI provider still has dependents. Live references always block; soft dependents block unless force=true. See error.meta for counts, offending IDs, and the forcible flag.