SpyBara
Go Premium

Documentation 2026-09-20 23:01 UTC to 2026-09-21 23:00 UTC

2 files changed +11 −11. View all changes and history on the product overview
2026
Mon 21 23:00 Tue 15 14:01 Fri 11 21:00 Mon 7 16:01 Thu 3 16:59

overview.md +6 −6

Details

70 70 

71You can also switch inside the TUI with `/model <name>`.71You can also switch inside the TUI with `/model <name>`.

72 72 

73## Use Grok 4.6 on the API73## Use Grok 4.7 on the API

74 74 

75The same model that powers Grok Build, [`grok-4.6`](/developers/models/grok-4.6), is also available directly on the xAI API. Drop it into your own agent loop, IDE integration, or coding tool.75[`grok-4.7`](/developers/models/grok-4.7), SpaceXAI's latest model, is available directly on the xAI API. Drop it into your own agent loop, IDE integration, or coding tool.

76 76 

77```bash customLanguage="bash"77```bash customLanguage="bash"

78curl https://api.x.ai/v1/responses \78curl https://api.x.ai/v1/responses \

79 -H "Authorization: Bearer $XAI_API_KEY" \79 -H "Authorization: Bearer $XAI_API_KEY" \

80 -H "Content-Type: application/json" \80 -H "Content-Type: application/json" \

81 -d '{81 -d '{

82 "model": "grok-4.6",82 "model": "grok-4.7",

83 "input": "Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}"83 "input": "Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}"

84 }'84 }'

85```85```


91 91 

92client = Client(api_key=os.getenv("XAI_API_KEY"))92client = Client(api_key=os.getenv("XAI_API_KEY"))

93 93 

94chat = client.chat.create(model="grok-4.6")94chat = client.chat.create(model="grok-4.7")

95chat.append(user("Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}"))95chat.append(user("Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}"))

96 96 

97print(chat.sample().content)97print(chat.sample().content)


106)106)

107 107 

108response = client.responses.create(108response = client.responses.create(

109 model="grok-4.6",109 model="grok-4.7",

110 input="Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}",110 input="Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}",

111)111)

112 112 


118import { generateText } from 'ai';118import { generateText } from 'ai';

119 119 

120const { text } = await generateText({120const { text } = await generateText({

121 model: xai.responses('grok-4.6'),121 model: xai.responses('grok-4.7'),

122 prompt: 'Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}',122 prompt: 'Fix this function and explain the bug: function median(a){a.sort();return a[a.length/2]}',

123});123});

124 124 

settings.md +5 −5

Details

33```toml customLanguage="toml"33```toml customLanguage="toml"

34[models]34[models]

35default = "grok-build" # recommended for coding / agent sessions35default = "grok-build" # recommended for coding / agent sessions

36web_search = "grok-4.6" # model used by client-side web_search tool36web_search = "grok-4.7" # model used by client-side web_search tool

37 37 

38[model."grok-4.6"]38[model."grok-4.7"]

39model = "grok-4.6" # id sent to the API39model = "grok-4.7" # id sent to the API

40base_url = "https://api.x.ai/v1" # provider endpoint40base_url = "https://api.x.ai/v1" # provider endpoint

41name = "Grok 4.6" # shown in model picker41name = "Grok 4.7" # shown in model picker

42description = "Grok 4.6 from xAI"42description = "Grok 4.7 from xAI"

43env_key = "XAI_API_KEY" # env var holding the API key43env_key = "XAI_API_KEY" # env var holding the API key

44api_backend = "responses" # chat_completions | responses | messages44api_backend = "responses" # chat_completions | responses | messages

45temperature = 0.745temperature = 0.7