中文

The Grok Family

Models

Grok is our family of flagship LLMs. Our latest models are grok-2-1212 and grok-2-vision-1212. We recommend that all customers use the grok-2-1212 model family. The grok-beta models are early models that are now deprecated.grok.cadn.net.cn

The grok-2-1212 models have a knowledge cutoff date of July 17, 2024.grok.cadn.net.cn

grok-2-vision-1212
  • - grok-2-vision
  • - grok-2-vision-latest
Text Input
Image Input
Text Completion
grok-2-1212
  • - grok-2
  • - grok-2-latest
Text Input
Text Completion
grok-vision-beta
Text Input
Image Input
Text Completion
grok-beta
Text Input
Text Completion

Unlock the Universe's Secrets

To access Grok models via API, you must create an xAI account and an API key. grok.cadn.net.cn


  • No access to realtime events
    • Unlike grok.com and Grok in X, the Grok models on the xAI API are not connected to the internet.
    • Grok has no knowledge of current events or data beyond what was present in its training data (cutoff date of July 17, 2024). Please pass any realtime data as context in your system prompt.
  • Chat models
    • No role order limitation: You can mix system, user, or assistant roles in any sequence for your conversation context.
  • Image input models
    • Maximum image size: 10MiB
    • Maximum number of images: No limit
    • Supported image file types: jpg/jpeg or png.
    • Any image/text input order is accepted (e.g. text prompt can precede image prompt)
  • Embedding models
    • We do not offer embedding models by default.
    • To request access, please email support@x.ai with details about your intended use case.

Some models have aliases to help user automatically migrate to the next version of the same model. In general:grok.cadn.net.cn

  • <modelname> is aliased to the latest stable version.
  • <modelname> - latest is aliased to the latest version. This is suitable for users who want to access the latest features.
  • <modelname> - <date> refers directly to a specific model release. This will not be updated and is for workflows that demand consistency.

For most users, the aliased <modelname> or <modelname> - latest are recommended, as you would receive the latest features automatically.grok.cadn.net.cn


Your model access might vary depending on various factors such as geographical location, account limitations, etc.grok.cadn.net.cn

For how the bills are charged or managing a team's API key permissions, visit Billing and Teams Management for more information.grok.cadn.net.cn

For the most up-to-date information on your team's model availability, visit Models Page on xAI Console.grok.cadn.net.cn


Each model can have one or multiple input and output capabilities. The input capabilities refer to which type(s) of prompt can the model accept in the request message body. The output capabilities refer to which type(s) of completion will the model generate in the response message body.grok.cadn.net.cn

This is a prompt example for models with text input capability:grok.cadn.net.cn

[
  {
    "role": "system",
    "content": "You are Grok, a chatbot inspired by the Hitchhikers Guide to the Galaxy."
  },
  {
    "role": "user",
    "content": "What is the meaning of life, the universe, and everything?"
  }
]

This is a prompt example for models with text and image input capabilities:grok.cadn.net.cn

[
  {
    "role": "user",
    "content": [
      {
        "type": "image_url",
        "image_url": {
          "url": "data:image/jpeg;base64,<base64_image_string>",
          "detail": "high"
        },
      },
      {
        "type": "text",
        "text": "Describe what's in this image."
      }
    ]
  }
]

The context window determines the maximum amount of token accepted by the model in the prompt.grok.cadn.net.cn

For more information on how token is counted, visit Consumption and Rate Limits.grok.cadn.net.cn

If you are sending the entire conversation history in the prompt for use cases like chat assistant, the sum of all the prompts in your conversation history must be no greater than the context window.grok.cadn.net.cn