File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ SwiftOpenAI supports various providers that are OpenAI-compatible, including but
107
107
- [ Gemini] ( #gemini )
108
108
- [ Ollama] ( #ollama )
109
109
- [ Groq] ( #groq )
110
+ - [ xAI] ( #xai )
110
111
- [ OpenRouter] ( #openRouter )
111
112
- [ DeepSeek] ( #deepseek )
112
113
- [ AIProxy] ( #aiproxy )
@@ -4113,6 +4114,19 @@ let service = OpenAIServiceFactory.service(apiKey: apiKey, overrideBaseURL: "htt
4113
4114
4114
4115
For Supported API's using Groq visit its [documentation](https :// console.groq.com/docs/openai).
4115
4116
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
+
4116
4130
## OpenRouter
4117
4131
4118
4132
< img width= " 734" alt= " Image" src= " https://github.com/user-attachments/assets/2d658d07-0b41-4b5f-a094-ec7856f6fe98" />
You can’t perform that action at this time.
0 commit comments