Llm
API Endpoint POST : https://aihub.dev/api/v1/{your-key}/chat
LLM Chat API enables you to have conversations about any topic. It's the perfect solution for startups and companies looking to implement new AI-based features.
# Here is a curl example
curl --location --globoff \
'https://aihub.dev/api/v1/{your-api-key}/chat' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model":"gpt-4o-mini",
"content":"hi!",
"role": "user"
}'
Result fields:
{
"status": "string",
"data": {
"model": "string",
"role": "string",
"message": "string",
"cost": "integer"
}
}
PARAMETERS
Field | Type | Required | Description |
---|---|---|---|
model | string | Yes | Ai model name |
content | string | Yes | Content you wan't send to llm model |
role | string | Yes | Role |
Errors
The AiHub API uses the following error codes:
Error Code | Meaning |
---|---|
200 | The request is OK. |
400 | Bad Request. |
401 | Payment Required. |