TensaHub › OpenRouter

Cohere: Command A

API del modelo cohere/command-a en OpenRouter, $2.5 / $10 por millón de tokens, contexto 256.000 tokens. Ejemplos en curl, Python y JavaScript, prueba en directo.

Probar y valorar en el catálogo

Command A is an open-weights 111B parameter model with a 256k context window focused on delivering great performance across agentic, multilingual, and coding use cases. Compared to other leading proprietary...

Tipo
Modelo
Proveedor
OpenRouter
ID del modelo
cohere/command-a
Precio
De pago
Precio entrada / salida
$2.5 / $10 por millón de tokens
Acceso sin clave
No
Variable de clave
OPENROUTER_API_KEY
URL base (compatible con OpenAI)
https://openrouter.ai/api/v1
Contexto
256.000 tokens
Entradas
Texto
Funciones
Salida JSON, Llamada a herramientas
Valoración de desarrolladores
Aún sin valorar
Documentación
https://openrouter.ai/cohere/command-a

Ejemplos de código

cURL

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -d '{"model":"cohere/command-a","messages":[{"role":"user","content":"Hola, preséntate en una frase."}]}'

Python

# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"])
r = client.chat.completions.create(
    model="cohere/command-a",
    messages=[{"role": "user", "content": "Hola, preséntate en una frase."}],
)
print(r.choices[0].message.content)

JavaScript

// npm install openai
import OpenAI from 'openai'

const client = new OpenAI({ baseURL: 'https://openrouter.ai/api/v1', apiKey: process.env.OPENROUTER_API_KEY })
const r = await client.chat.completions.create({
  model: 'cohere/command-a',
  messages: [{ role: 'user', content: 'Hola, preséntate en una frase.' }],
})
console.log(r.choices[0].message.content)

Generar el código de integración →

Búsquedas populares

Preguntas frecuentes

¿Es gratuita la API de Cohere: Command A?

No: Cohere: Command A es una API de pago ($2.5 / $10 por millón de tokens).

¿Cómo llamo a Cohere: Command A desde mi código?

Cohere: Command A ofrece una API compatible con OpenAI en https://openrouter.ai/api/v1: usa cualquier SDK de OpenAI (Python, JavaScript…) con esta URL base. Identificador del modelo: cohere/command-a. Hay código listo para usar (streaming, JSON, reintentos) en la caja de herramientas para desarrolladores.

¿Cuál es la ventana de contexto de Cohere: Command A?

Cohere: Command A acepta hasta 256.000 tokens de contexto (mensaje e historial).

¿Qué alternativas hay a Cohere: Command A?

API similares del catálogo: Cohere: Command A+, Cohere: Command R7B (12-2024), Cohere: Command R (08-2024), Cohere: Command R+ (08-2024).

Alternativas