Skip to content

Commit 5e16683

Browse files
Merge pull request #149 from AlekseyPleshkov/patch-1
Adds xAI information to README.md
2 parents f44490f + 23a500b commit 5e16683

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ SwiftOpenAI supports various providers that are OpenAI-compatible, including but
107107
- [Gemini](#gemini)
108108
- [Ollama](#ollama)
109109
- [Groq](#groq)
110+
- [xAI](#xai)
110111
- [OpenRouter](#openRouter)
111112
- [DeepSeek](#deepseek)
112113
- [AIProxy](#aiproxy)
@@ -4113,6 +4114,19 @@ let service = OpenAIServiceFactory.service(apiKey: apiKey, overrideBaseURL: "htt
41134114

41144115
For Supported API's using Groq visit its [documentation](https://console.groq.com/docs/openai).
41154116

4117+
## xAI
4118+
4119+
<img width="792" alt="xAI Grok" src="https://github.com/user-attachments/assets/596ef28a-b8ea-4868-b37c-36ae28d77a30">
4120+
4121+
xAI provides an OpenAI-compatible completion API to its Grok models. You can use the OpenAI SDK to access these models.
4122+
4123+
```swift
4124+
let apiKey = "your_api_xai_key"
4125+
let service = OpenAIServiceFactory.service(apiKey: apiKey, overrideBaseURL: "https://api.x.ai", overrideVersion: "v1")
4126+
```
4127+
4128+
For more information about the `xAI` api visit its [documentation](https://docs.x.ai/docs/overview).
4129+
41164130
## OpenRouter
41174131

41184132
<img width="734" alt="Image" src="https://github.com/user-attachments/assets/2d658d07-0b41-4b5f-a094-ec7856f6fe98" />

0 commit comments

Comments
 (0)