Chat Rápido Gemini-2.5-pro
curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-2.5-pro",
"messages": [
{
"role": "user",
"content": "Hello, introduce yourself"
}
]
}
'import requests
url = "https://direct.evolink.ai/v1/chat/completions"
payload = {
"model": "gemini-2.5-pro",
"messages": [
{
"role": "user",
"content": "Hello, introduce yourself"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gemini-2.5-pro',
messages: [{role: 'user', content: 'Hello, introduce yourself'}]
})
};
fetch('https://direct.evolink.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://direct.evolink.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gemini-2.5-pro',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, introduce yourself'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://direct.evolink.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gemini-2.5-pro\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, introduce yourself\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://direct.evolink.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gemini-2.5-pro\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, introduce yourself\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gemini-2.5-pro\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, introduce yourself\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-20251010015944503180122WJNB8Eid",
"model": "gemini-2.5-pro",
"object": "chat.completion",
"created": 1760032810,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Note: This is sample code!\n\nHello! I'm pleased to introduce myself.\n\nI'm a Large Language Model, trained and developed by Google..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 13,
"completion_tokens": 1891,
"total_tokens": 1904,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 13,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 1480
},
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": null
}
}{
"error": {
"code": 400,
"message": "Parámetros de solicitud inválidos",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Cuota insuficiente",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/billing"
}
}{
"error": {
"code": 403,
"message": "Access denied for this model",
"type": "permission_error",
"param": "model"
}
}{
"error": {
"code": 404,
"message": "Specified model not found",
"type": "not_found_error",
"param": "model",
"fallback_suggestion": "gemini-2.5-pro"
}
}{
"error": {
"code": 429,
"message": "Semilla aleatoria, rango `[1, 2147483647]`\n\n**Nota:**\n- Usar el mismo valor de semilla puede mantener resultados de generación consistentes\n- Dejar vacío para semilla aleatoria",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Error interno del servidor",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 502,
"message": "Upstream AI service unavailable",
"type": "upstream_error",
"fallback_suggestion": "try different model"
}
}{
"error": {
"code": 503,
"message": "Servicio temporalmente no disponible",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}OpenAI SDK Format
Gemini 3.0 Flash - Native API - Referencia completa
- Llamar al modelo Gemini-2.5-pro usando el formato del SDK de OpenAI
- Modo de procesamiento síncrono, devuelve el contenido de la conversación en tiempo real
- Parámetros mínimos para inicio rápido
- 💡 ¿Necesitas más funciones? Consulta la Referencia completa de la API
POST
/
v1
/
chat
/
completions
Chat Rápido Gemini-2.5-pro
curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-2.5-pro",
"messages": [
{
"role": "user",
"content": "Hello, introduce yourself"
}
]
}
'import requests
url = "https://direct.evolink.ai/v1/chat/completions"
payload = {
"model": "gemini-2.5-pro",
"messages": [
{
"role": "user",
"content": "Hello, introduce yourself"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gemini-2.5-pro',
messages: [{role: 'user', content: 'Hello, introduce yourself'}]
})
};
fetch('https://direct.evolink.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://direct.evolink.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gemini-2.5-pro',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, introduce yourself'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://direct.evolink.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gemini-2.5-pro\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, introduce yourself\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://direct.evolink.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gemini-2.5-pro\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, introduce yourself\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gemini-2.5-pro\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, introduce yourself\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-20251010015944503180122WJNB8Eid",
"model": "gemini-2.5-pro",
"object": "chat.completion",
"created": 1760032810,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Note: This is sample code!\n\nHello! I'm pleased to introduce myself.\n\nI'm a Large Language Model, trained and developed by Google..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 13,
"completion_tokens": 1891,
"total_tokens": 1904,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 13,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 1480
},
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": null
}
}{
"error": {
"code": 400,
"message": "Parámetros de solicitud inválidos",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Cuota insuficiente",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/billing"
}
}{
"error": {
"code": 403,
"message": "Access denied for this model",
"type": "permission_error",
"param": "model"
}
}{
"error": {
"code": 404,
"message": "Specified model not found",
"type": "not_found_error",
"param": "model",
"fallback_suggestion": "gemini-2.5-pro"
}
}{
"error": {
"code": 429,
"message": "Semilla aleatoria, rango `[1, 2147483647]`\n\n**Nota:**\n- Usar el mismo valor de semilla puede mantener resultados de generación consistentes\n- Dejar vacío para semilla aleatoria",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Error interno del servidor",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 502,
"message": "Upstream AI service unavailable",
"type": "upstream_error",
"fallback_suggestion": "try different model"
}
}{
"error": {
"code": 503,
"message": "Servicio temporalmente no disponible",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}BaseURL: La BaseURL predeterminada es
https://direct.evolink.ai, que ofrece mejor compatibilidad con modelos de texto y admite conexiones persistentes. https://api.evolink.ai es el endpoint principal para servicios multimodales y actúa como dirección de respaldo para los modelos de texto.Autorizaciones
##Todas las APIs requieren autenticación Bearer Token##
Obtener API Key:
Visita la Página de gestión de API Key para obtener tu API Key
Agregar al encabezado de la solicitud:
Authorization: Bearer YOUR_API_KEY
Cuerpo
application/json
Nombre del modelo de chat
Opciones disponibles:
gemini-2.5-pro Ejemplo:
"gemini-2.5-pro"
Lista de mensajes de chat
Minimum array length:
1Show child attributes
Show child attributes
Ejemplo:
[
{
"role": "user",
"content": "Hello, introduce yourself"
}
]
Respuesta
Completado de chat generado exitosamente
Identificador único para la completación de chat
Ejemplo:
"chatcmpl-20251010015944503180122WJNB8Eid"
Nombre del modelo realmente utilizado
Ejemplo:
"gemini-2.5-pro"
Tipo de respuesta
Opciones disponibles:
chat.completion Ejemplo:
"chat.completion"
Marca de tiempo de creación
Ejemplo:
1760032810
Lista de opciones de completado de chat
Show child attributes
Show child attributes
Estadísticas de uso de tokens
Show child attributes
Show child attributes
⌘I