Cohere: Embed v4 contra Mistral: Codestral Embed 2505
Uma comparação lado a lado entre Cohere: Embed v4 (US$ 0,42 / 1M fragmentos (≈ R$ 2,39)) e Mistral: Codestral Embed 2505 (US$ 0,52 / 1M fragmentos (≈ R$ 2,98)) com preços em USD e recursos atuais do catálogo do api14. Os dois funcionam pela mesma API compatível com OpenAI.
Especificações
| Cohere: Embed v4 | Mistral: Codestral Embed 2505 | |
|---|---|---|
| Provedor | Cohere | Mistral |
| Entrada | US$ 0,42 / 1M fragmentos (≈ R$ 2,39) | US$ 0,52 / 1M fragmentos (≈ R$ 2,98) |
| Janela de contexto | 128.000 | 8.192 |
| Saída máxima | 115.200 | 6.553 |
| Entrada | image, text | text |
| Saída | embeddings | embeddings |
| chamada de ferramentas | ||
| Saída estruturada | ||
| Controle de raciocínio | ||
| Adicionado em | 15 de nov. de 2025 | 30 de out. de 2025 |
Principais diferenças
- Cohere: Embed v4 é 20% mais barato nos tokens de entrada.
- Cohere: Embed v4 lê 15.6× mais contexto (128.000 tokens).
Troque com uma string
Os dois modelos usam o mesmo endpoint e o mesmo formato de requisição. Mude o valor de model de "cohere/embed-v4" para "mistralai/codestral-embed-2505", prompts, streaming e ferramentas continuam funcionando.
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": "mistralai/codestral-embed-2505",
"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="mistralai/codestral-embed-2505",
input=[
"The quick brown fox",
"Lorem ipsum"
],
)
print([len(d.embedding) for d in result.data])
curl https://api14.com/api/v1/embeddings \
-H "Authorization: Bearer $API14_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistralai/codestral-embed-2505",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
}'
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"model": "mistralai/codestral-embed-2505",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
}`)
req, _ := http.NewRequest("POST", "https://api14.com/api/v1/embeddings", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("API14_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
<?php
$ch = curl_init("https://api14.com/api/v1/embeddings");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("API14_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"model" => "mistralai/codestral-embed-2505",
"input" => [
"The quick brown fox",
"Lorem ipsum"
]
]),
]);
$response = json_decode(curl_exec($ch), true);
print_r($response);
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": "mistralai/codestral-embed-2505",
"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": "mistralai/codestral-embed-2505",
"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());
require "net/http"
require "json"
uri = URI("https://api14.com/api/v1/embeddings")
req = Net::HTTP::Post.new(uri, {
"Authorization" => "Bearer #{ENV["API14_API_KEY"]}",
"Content-Type" => "application/json",
})
req.body = {
"model": "mistralai/codestral-embed-2505",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |h| h.request(req) }
puts JSON.parse(res.body)
// 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": "mistralai/codestral-embed-2505",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
}))
.send()
.await?
.text()
.await?;
println!("{res}");
Ok(())
}
Mais comparações
- Cohere: Embed 5 Fast contra Cohere: Embed English v3
- Cohere: Embed 5 Fast contra Cohere: Embed Multilingual v3
- Cohere: Embed 5 Fast contra Perplexity: Embed V2 Context 0.6B
- Cohere: Embed 5 Fast contra Perplexity: Embed V2 Context 9B
- Cohere: Embed English v3 contra Cohere: Embed Multilingual v3
- Cohere: Embed English v3 contra Perplexity: Embed V2 Context 0.6B
- Cohere: Embed English v3 contra Perplexity: Embed V2 Context 9B
- Cohere: Embed Multilingual v3 contra Perplexity: Embed V2 Context 0.6B