Create a new LLM provider
POST
/api/v1/llm_provider
const url = 'https://app.prefactorai.com/api/v1/llm_provider';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"account_id":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","api_base_url":"https://api.example.com/v1","api_key":"sk-test-key","id":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","name":"Anthropic production","provider":"anthropic"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”LlmProvider_DetailsForCreate
object
account_id
One of:
Account_Id
A valid account ID
string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyNull
Null
string
api_key
required
API key for this provider. Stored encrypted and never returned in API responses
string
Example
sk-test-keyid
One of:
LlmProvider_Id
A valid LLM provider ID
string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyNull
Null
string
name
required
Provider name, unique within the account ignoring case
string
Example
Anthropic productionprovider
required
LLM provider kind
string
Example
anthropicResponses
Section titled “Responses”Success
Media typeapplication/json
object
details
required
LlmProvider_Details
object
account_id
required
Account_Id
A valid account ID
string
api_type
required
API dialect derived from the provider kind
string
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
type
required
Type of resource (always ‘llm_provider’)
string
status
required
string
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"}default
Section titled “default”Error
Media typeapplication/json
One of:
object
code
required
string
message
required
string
status
required
string
object
code
required
string
errors
required
object
key
additional properties
object recursive
message
required
string
status
required
string
object
code
required
string
message
required
string
retry_after_ms
required
Milliseconds until the client may retry.
integer
status
required
string
object
code
required
string
latest_revision_id
required
KnowledgebaseDocumentRevision_Id
A valid knowledgebase document revision ID
string
message
required
string
status
required
string
Example
{ "code": "bad_request", "status": "error"}