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
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
41144115For 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" />
You can’t perform that action at this time.
0 commit comments