/
ModèlesSupportEntrepriseBlog
500+ API de modèles IA, toutes en une seule API. Simplement avec CometAPI
API des modèles
Développeur
Démarrage rapideDocumentationTableau de bord API
Ressources
Modèles d'IABlogEntrepriseJournal des modificationsÀ propos
2025 CometAPI. Tous droits réservés.Politique de confidentialitéConditions d'utilisation
Home/Models/xAI/Grok 2
X

Grok 2

Entrée:$0.8/M
Sortie:$3.2/M
Grok 2 é um modelo de inteligência artificial fornecido pela XAI.
Nouveau
Usage commercial
Aperçu
Fonctionnalités
Tarification
API
Versions

Technical Specifications of grok-2

SpecificationDetails
Model IDgrok-2
ProviderXAI
ModalitiesText input, text output
Context windowVaries by deployment
Streaming supportSupported via API, depending on client implementation
Function/tool callingDepends on deployment compatibility
Typical use casesChat, question answering, summarization, writing assistance, coding support

What is grok-2?

grok-2 is an artificial intelligence model provided by XAI. It is designed to handle natural language tasks such as answering questions, generating text, assisting with writing, summarizing content, and supporting general conversational workflows.

As a model available through CometAPI, grok-2 can be integrated into applications that need reliable text generation and language understanding capabilities through a unified API experience.

Main features of grok-2

  • Natural language generation: Produces human-like text for chat, drafting, brainstorming, and content creation.
  • Question answering: Helps respond to factual, instructional, and conversational prompts across many domains.
  • Summarization: Can condense long passages into shorter, more digestible outputs.
  • Writing assistance: Useful for rewriting, polishing, expanding, or simplifying text.
  • Developer integration: Accessible through API-based workflows for easy inclusion in apps and services.
  • Unified access through CometAPI: Lets developers use grok-2 through CometAPI’s consistent model interface.

How to access and integrate grok-2

Step 1: Sign Up for API Key

Sign up on CometAPI and generate your API key from the dashboard. Once you have the key, store it securely and use it to authenticate requests to the CometAPI endpoint.

Step 2: Send Requests to grok-2 API

Use the standard CometAPI chat completions endpoint and specify the model as grok-2.

curl --request POST \
  --url https://api.cometapi.com/v1/chat/completions \
  --header "Authorization: Bearer YOUR_COMETAPI_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "grok-2",
    "messages": [
      {
        "role": "user",
        "content": "Hello! What can you help me with?"
      }
    ]
  }'

Step 3: Retrieve and Verify Results

Parse the JSON response returned by the API and read the generated content from the first response choice. Validate the output format and add application-level checks as needed for your use case before displaying results to end users.

Fonctionnalités pour Grok 2

Découvrez les fonctionnalités clés de Grok 2, conçues pour améliorer les performances et la facilité d'utilisation. Explorez comment ces capacités peuvent bénéficier à vos projets et améliorer l'expérience utilisateur.

Tarification pour Grok 2

Découvrez des tarifs compétitifs pour Grok 2, conçus pour s'adapter à différents budgets et besoins d'utilisation. Nos formules flexibles garantissent que vous ne payez que ce que vous utilisez, ce qui facilite l'adaptation à mesure que vos besoins évoluent. Découvrez comment Grok 2 peut améliorer vos projets tout en maîtrisant les coûts.
Prix de Comet (USD / M Tokens)Prix officiel (USD / M Tokens)Remise
Entrée:$0.8/M
Sortie:$3.2/M
Entrée:$1/M
Sortie:$4/M
-20%

Exemple de code et API pour Grok 2

Accédez à des exemples de code complets et aux ressources API pour Grok 2 afin de simplifier votre processus d'intégration. Notre documentation détaillée fournit des instructions étape par étape pour vous aider à exploiter tout le potentiel de Grok 2 dans vos projets.

Versions de Grok 2

La raison pour laquelle Grok 2 dispose de plusieurs instantanés peut inclure des facteurs potentiels tels que des variations de sortie après des mises à jour nécessitant des instantanés plus anciens pour la cohérence, offrant aux développeurs une période de transition pour l'adaptation et la migration, et différents instantanés correspondant à des points de terminaison globaux ou régionaux pour optimiser l'expérience utilisateur. Pour les différences détaillées entre les versions, veuillez consulter la documentation officielle.
version
grok-2-1212
grok-2-vision-1212
grok-2

Plus de modèles