External API предоставляет доступ к AI моделям через REST API с аутентификацией по API ключам.
Базовый URL
https://smmcode.com/api/v1/external
Интегрируйте AI модели в свои приложения через простой REST API
External API предоставляет доступ к AI моделям через REST API с аутентификацией по API ключам.
https://smmcode.com/api/v1/external
Все запросы требуют API ключ в заголовке Authorization:
Authorization: Bearer sk_live_your_api_key_here
API ключи создаются в личном кабинете пользователя в разделе "API Ключи".
sk_live_[48 случайных символов]
Отправка сообщения и получение полного ответа (синхронно)
curl -X POST https://smmcode.com/api/v1/external/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-3.5-sonnet",
"messages": [
{"role": "user", "content": "Привет!"}
],
"temperature": 0.7,
"max_tokens": 2048
}'
| Параметр | Тип | Описание |
|---|---|---|
model |
string | ID модели (обязательно) |
messages |
array | Массив сообщений (обязательно) |
temperature |
float | 0-2, по умолчанию 0.7 |
max_tokens |
integer | 1-8192, по умолчанию 2048 |
Потоковая отправка ответа через Server-Sent Events (SSE)
Параметры запроса такие же как для /chat/completions
Получение списка доступных моделей
curl https://smmcode.com/api/v1/external/models \
-H "Authorization: Bearer YOUR_API_KEY"
Получение текущего баланса пользователя
Получение статистики использования API с фильтрацией и пагинацией
import requests
url = "https://smmcode.com/api/v1/external/chat/completions"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"model": "anthropic/claude-3.5-sonnet",
"messages": [
{"role": "user", "content": "Привет!"}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const axios = require('axios');
const url = 'https://smmcode.com/api/v1/external/chat/completions';
const headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
};
const data = {
model: 'anthropic/claude-3.5-sonnet',
messages: [
{ role: 'user', content: 'Привет!' }
]
};
axios.post(url, data, { headers })
.then(response => console.log(response.data))
.catch(error => console.error(error));
$url = 'https://smmcode.com/api/v1/external/chat/completions';
$apiKey = 'YOUR_API_KEY';
$data = [
'model' => 'anthropic/claude-3.5-sonnet',
'messages' => [
['role' => 'user', 'content' => 'Привет!']
]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
При возникновении вопросов или проблем:
google/gemini-3-flash-preview
google/gemini-3-pro-preview
openai/gpt-5.1-codex-max
openai/gpt-5.2
openai/gpt-5.2-chat
openai/gpt-5.2-pro
x-ai/grok-4.1-fast
qwen/qwen3-32b
openai/gpt-oss-120b
google/gemini-2.5-flash-lite
meta-llama/llama-4-scout
meta-llama/llama-4-maverick
deepseek/deepseek-v3.1-terminus
qwen/qwen3-235b-a22b
google/gemini-2.5-pro
openai/gpt-5-nano
openai/gpt-5-mini
anthropic/claude-haiku-4.5
openai/gpt-5
anthropic/claude-3.7-sonnet
anthropic/claude-opus-4
anthropic/claude-opus-4.1
anthropic/claude-sonnet-4.5
x-ai/grok-4
x-ai/grok-3-mini-beta