Skip to content

Create a new LLM provider

POST
/api/v1/llm_provider
curl --request POST \
--url https://app.prefactorai.com/api/v1/llm_provider \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "api_base_url": "https://api.example.com/v1", "api_key": "sk-test-key", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "name": "Anthropic production", "provider": "anthropic" }'
LlmProvider_DetailsForCreate
object
account_id
One of:
Account_Id

A valid account ID

string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkeny
api_base_url
One of:
string
Example
https://api.example.com/v1
api_key
required

API key for this provider. Stored encrypted and never returned in API responses

string
Example
sk-test-key
id
One of:
LlmProvider_Id

A valid LLM provider ID

string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkeny
name
required

Provider name, unique within the account ignoring case

string
Example
Anthropic production
provider
required

LLM provider kind

string
Allowed values: anthropic openai ollama_cloud together custom_openai
Example
anthropic

Success

Media typeapplication/json
object
details
required
LlmProvider_Details
object
account_id
required
Account_Id

A valid account ID

string
api_base_url
required
One of:
string
api_type
required

API dialect derived from the provider kind

string
Allowed values: claude openai
id
required
LlmProvider_Id

A valid LLM provider ID

string
name
required

Provider name, unique within the account ignoring case

string
provider
required

LLM provider kind

string
Allowed values: anthropic openai ollama_cloud together custom_openai
type
required

Type of resource (always ‘llm_provider’)

string
Allowed values: llm_provider
status
required
string
Allowed values: success
Example
{
"details": {
"account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny",
"api_base_url": "https://api.example.com/v1",
"api_type": "claude",
"id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny",
"name": "Anthropic production",
"provider": "anthropic",
"type": "llm_provider"
},
"status": "success"
}

Error

Media typeapplication/json
One of:
object
code
required
string
Allowed values: bad_request bad_authtoken not_authenticated not_permitted not_implemented unknown not_found unexpected_ref_type unexpected invalid_action invalid_state alert_unknown alert_already_cleared invalid_value required_value idempotency_key_already_used temporarily_unavailable conflict
message
required
string
status
required
string
Allowed values: error
Example
{
"code": "bad_request",
"status": "error"
}