Create an AI provider
Create a new AI provider.
Request
Authentication
Include your private API key in the request headers:
Authorization: Bearer YOUR_PRIVATE_API_KEY
Request Body
Example request
OpenAI provider
curl -X POST "https://superinterface.ai/api/cloud/providers" \
-H "Authorization: Bearer YOUR_PRIVATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "OPENAI",
"apiKey": "sk-proj-12345",
"name": ""
}'
Azure AI Project provider
curl -X POST "https://superinterface.ai/api/cloud/providers" \
-H "Authorization: Bearer YOUR_PRIVATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "AZURE_AI_PROJECT",
"endpoint": "https://my-project.services.ai.azure.com/",
"azureTenantId": "your-tenant-id",
"azureClientId": "your-client-id",
"azureClientSecret": "your-client-secret"
}'
Response
Example response
OpenAI Provider Response
{
"provider": {
"id": "114a170b-9770-4dcf-9f18-8b464482e41d",
"type": "OPENAI",
"name": "",
"apiKey": "sk-proj-12345",
"apiVersion": null,
"endpoint": null,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-16T12:00:00Z"
}
}
Azure AI Project Provider Response
{
"provider": {
"id": "214a170b-9770-4dcf-9f18-8b464482e41e",
"type": "AZURE_AI_PROJECT",
"name": "",
"apiKey": null,
"apiVersion": null,
"endpoint": "https://my-project.services.ai.azure.com/",
"azureTenantId": "your-tenant-id",
"azureClientId": "your-client-id",
"azureClientSecret": "your-client-secret",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-16T12:00:00Z"
}
}
Errors
The endpoint may return the following errors:
401 Unauthorized
This error occurs if the API key is invalid or missing.
{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}