Grok 2

Grok-2, xAI's latest language model, boasts superior reasoning, coding, and chat capabilities, outperforming many popular LLMs.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/grok-2"; const data = { "messages": [ { "role": "user", "content": "tell me a joke on cats" }, { "role": "assistant", "content": "here is a joke about cats..." }, { "role": "user", "content": "now a joke on dogs" } ] }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
application/json
HTTP Response Codes
200 - OKResponse Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


messagesArray

An array of objects containing the role and content


rolestr

Could be "user", "assistant" or "system".


contentstr

A string containing the user's query or the assistant's response.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Grok-2

xAI's Grok-2 represents a significant advancement in language model technology, offering state-of-the-art reasoning capabilities. As a successor to Grok-1.5, Grok-2 demonstrates substantial improvements in chat, coding, and reasoning. Alongside Grok-2, xAI is introducing Grok-2 mini, a smaller model that balances speed and quality.

Key Features of Grok-2

  • Superior Performance: Grok-2 outperforms both Claude 3.5 Sonnet and GPT-4-Turbo on the LMSYS leaderboard. An early version of Grok-2 was tested under the name "sus-column-r".

  • Enhanced Reasoning: Grok-2 showcases improvements in reasoning with retrieved content and tool use. It can accurately identify missing information, reason through sequences of events, and disregard irrelevant posts.

  • Benchmark Results: Grok-2 demonstrates competitive performance in graduate-level science knowledge (GPQA), general knowledge (MMLU, MMLU-Pro), and math competition problems (MATH). It also excels in vision-based tasks, achieving state-of-the-art results in visual math reasoning (MathVista) and document-based question answering (DocVQA)

Additional Information

  • Multimodal Understanding: xAI plans to release a preview of multimodal understanding as a core feature of Grok on ๐• and via the API.

  • Continued Innovation: xAI is focused on advancing core reasoning capabilities and has plans for further developments.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.