Point Xcode's coding intelligence at the OpenDunes OpenAI-compatible endpoint to use any model in your catalog.
Xcode 16+ supports configuring a custom OpenAI-compatible endpoint for its coding assistant. By pointing it at OpenDunes, you can use any model in the catalog — including Anthropic, Google, and open-source models — for code completions and inline assistance, with usage billed in Algerian Dinars.
https://opendunes.com/v1provider/model slug you want to use (e.g. anthropic/claude-sonnet-5)For coding tasks, prefer models with strong code capabilities. Some good starting points:
| Model | Slug | Strength |
|---|---|---|
| Claude Fable 5 | anthropic/claude-sonnet-5 | Instruction following, code generation |
| Claude Opus 4.8 | anthropic/claude-opus-4.8 | Complex reasoning, large codebases |
| GPT-5.4 | openai/gpt-5.4 | Fast completions, broad language support |
| Gemini 2.5 Pro | google/gemini-2.5-pro | Long context, multimodal |
Browse the full catalog at /models and filter by capability.
You can also call OpenDunes from Swift code in your app using URLSession:
import Foundation
struct Message: Codable {
let role: String
let content: String
}
struct ChatRequest: Codable {
let model: String
let messages: [Message]
}
struct ChatChoice: Codable {
struct Delta: Codable { let content: String? }
let message: Message
}
struct ChatResponse: Codable {
let choices: [ChatChoice]
}
func askOpenDunes(prompt: String) async throws -> String {
let url = URL(string: "https://opendunes.com/v1/chat/completions")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer \(ProcessInfo.processInfo.environment["OPENDUNES_API_KEY"] ?? "")", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let body = ChatRequest(
model: "anthropic/claude-sonnet-5",
messages: [Message(role: "user", content: prompt)]
)
request.httpBody = try JSONEncoder().encode(body)
let (data, _) = try await URLSession.shared.data(for: request)
let response = try JSONDecoder().decode(ChatResponse.self, from: data)
return response.choices.first?.message.content ?? ""
}Note. Never hardcode your API key in source code. Use environment variables for development and a secure secrets manager (like Xcode's
.xcconfig+ a server-side proxy) for production app builds.
402.