Create an AI provider

Create a new AI provider.

Request

POST https://superinterface.ai/api/cloud/providers

Authentication

Include your private API key in the request headers:
Authorization: Bearer YOUR_PRIVATE_API_KEY

Request Body

ParameterTypeRequiredDescription
typeProviderTypeYesProviderType (e.g., OPENAI)
apiKeystringNoAPI key for the provider
namestringNoDisplay name for the provider
endpointstringNoEndpoint URL for the provider
apiVersionstringNoAPI version for the provider
azureTenantIdstringNoAzure tenant ID (required for AZURE_AI_PROJECT)
azureClientIdstringNoAzure client ID (required for AZURE_AI_PROJECT)
azureClientSecretstringNoAzure client secret (required for AZURE_AI_PROJECT)

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

ParameterTypeDescription
providerProviderNew Provider

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" }