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.
- Open Xcode and go to Settings → AI.
- Under Model Provider, select Custom (OpenAI-compatible).
- Enter the following:
- Base URL:
https://opendunes.com/api/v1
- API Key: your key from your dashboard
- Model: the
provider/model slug you want to use (e.g. anthropic/claude-sonnet-5)
- Click Verify to confirm connectivity, then Save.
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/api/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.
- Xcode's AI features require macOS 14.0+ and Xcode 16+.
- The coding assistant feature sends your current file context as part of the request — each interaction consumes tokens billed from your DA balance.
- Rate limits apply per key (default 60 requests/minute). If Xcode's assistant feels slow, it may be hitting the limit — check your dashboard or increase the limit for your key.