Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ SwiftOpenAI supports various providers that are OpenAI-compatible, including but
- [Gemini](#gemini)
- [Ollama](#ollama)
- [Groq](#groq)
- [xAI](#xai)
- [OpenRouter](#openRouter)
- [DeepSeek](#deepseek)
- [AIProxy](#aiproxy)
Expand Down Expand Up @@ -4113,6 +4114,19 @@ let service = OpenAIServiceFactory.service(apiKey: apiKey, overrideBaseURL: "htt

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

## xAI

<img width="792" alt="xAI Grok" src="https://github.com/user-attachments/assets/596ef28a-b8ea-4868-b37c-36ae28d77a30">

xAI provides an OpenAI-compatible completion API to its Grok models. You can use the OpenAI SDK to access these models.

```swift
let apiKey = "your_api_xai_key"
let service = OpenAIServiceFactory.service(apiKey: apiKey, overrideBaseURL: "https://api.x.ai", overrideVersion: "v1")
```

For more information about the `xAI` api visit its [documentation](https://docs.x.ai/docs/overview).

## OpenRouter

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