Usamos cookies. Las cookies y el almacenamiento del navegador mantienen tu sesión iniciada y recuerdan tus preferencias. Con tu permiso, también medimos cómo se usa el sitio. Puedes en cualquier momento. Consulta nuestra política de cookies.
EsencialesSesión, seguridad y preferencias. Necesarias para que el sitio funcione.Siempre activas
¿Eres nuevo? Mira cómo funcionaUn recorrido de 1 minuto por el entorno de pruebas, los modelos y tu clave API.
Precios y documentación de la API de Embed English v3 · api14
El precio de entrada es 100% mayor que la mediana de 45 modelos de Incrustaciones.
Cómo llamar a la API de Cohere: Embed English v3
Crea una clave API en tu panel.
Instala el SDK oficial de openai para tu lenguaje.
Configura baseURL como https://api14.com/api/v1 y model como "cohere/embed-english-v3.0".
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.embeddings.create({
"model": "cohere/embed-english-v3.0",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
});
console.log(result.data.map((d) => d.embedding.length));
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api14.com/api/v1",
api_key=os.environ["API14_API_KEY"],
)
result = client.embeddings.create(
model="cohere/embed-english-v3.0",
input=[
"The quick brown fox",
"Lorem ipsum"
],
)
print([len(d.embedding) for d in result.data])
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"model": "cohere/embed-english-v3.0",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api14.com/api/v1/embeddings"))
.header("Authorization", "Bearer " + System.getenv("API14_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System.Net.Http.Headers;
using System.Text;
var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("API14_API_KEY"));
var body = """
{
"model": "cohere/embed-english-v3.0",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
}
""";
var res = await http.PostAsync("https://api14.com/api/v1/embeddings", new StringContent(body, Encoding.UTF8, "application/json"));
Console.WriteLine(await res.Content.ReadAsStringAsync());
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let key = std::env::var("API14_API_KEY")?;
let res = reqwest::Client::new()
.post("https://api14.com/api/v1/embeddings")
.bearer_auth(key)
.json(&json!({
"model": "cohere/embed-english-v3.0",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
}))
.send()
.await?
.text()
.await?;
println!("{res}");
Ok(())
}
Especificaciones
Longitud de contexto
512
Salida máxima
460
Entrada
text
Salida
embeddings
Solicitudes en api14 · últimos 7 días
Cohere: Embed English v3: preguntas frecuentes
¿Cuánto cuesta la API de Cohere: Embed English v3?
Cohere: Embed English v3 cuesta Entrada 0,35 US$ / 1M fragmentos. Se cobra de tu saldo en USD solo por las solicitudes correctas; las solicitudes fallidas son gratis.
¿Cuál es la ventana de contexto de Cohere: Embed English v3?
Cohere: Embed English v3 lee hasta 512 tokens por solicitud: prompt, historial y documentos en conjunto. Escribe hasta 460 tokens de salida por respuesta.
¿Qué puede hacer Cohere: Embed English v3?
Cohere: Embed English v3 acepta text y devuelve embeddings.
¿Cómo llamo a Cohere: Embed English v3 desde mi código?
Apunta cualquier SDK de OpenAI a https://api14.com/api/v1 y configura model como "cohere/embed-english-v3.0"; no hace falta cambiar nada más. Copia un ejemplo listo desde el panel de código de esta página.
¿Qué alternativas hay a Cohere: Embed English v3?
Modelos de Incrustaciones comparables a un precio similar: Cohere: Embed Multilingual v3, Amazon: Titan Embeddings G1 - Text, Mistral: Mistral Embed 2312. Todos funcionan con la misma clave API, así que cambiar es cuestión de una cadena.