Mobile Apps and Terminals

React Native, Flutter, Kotlin and Swift clients call the endpoint directly — no SDK, no bundler, no adapter.

A mobile app does not need the OpenAI SDK. The endpoint is plain HTTPS with CORS open to *, so the platform's own HTTP client is enough, and a WebView-based app can call it directly. This is what makes "use ZYRAXON from anything" true for phones rather than only for servers.

ℹ
The same two values
Base URL https://zyraxonai.lovable.app/api/public/zyraxon/v1, model zyraxon-codex, and Authorization: Bearer zyraxon unless the operator set a real key.

React Native and Expo

typescript
// React Native / Expo / any mobile JS runtime. No SDK needed.
const res = await fetch("https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer zyraxon" },
  body: JSON.stringify({
    model: "zyraxon-codex",
    messages: [{ role: "user", content: "Plan my day." }],
    stream: false,
  }),
});

const data = await res.json();
console.log(data.choices[0].message.content);

Flutter

dart
import 'dart:convert';
import 'package:http/http.dart' as http;

final res = await http.post(
  Uri.parse('https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions'),
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer zyraxon',
  },
  body: jsonEncode({
    'model': 'zyraxon-codex',
    'messages': [
      {'role': 'user', 'content': 'Plan my day.'},
    ],
  }),
);

final content = jsonDecode(res.body)['choices'][0]['message']['content'];

Android (Kotlin)

kotlin
// Plain HTTP, so it works from an Android app with no OpenAI SDK at all.
val client = OkHttpClient()
val json = """
  {"model":"zyraxon-codex","messages":[{"role":"user","content":"Plan my day."}]}
""".trimIndent()

val request = Request.Builder()
    .url("https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions")
    .addHeader("Content-Type", "application/json")
    .addHeader("Authorization", "Bearer zyraxon")
    .post(json.toRequestBody("application/json".toMediaType()))
    .build()

client.newCall(request).execute().use { response ->
    println(response.body?.string())
}

iOS (Swift)

swift
// URLSession, no SDK. Works on iOS, iPadOS and watchOS.
var request = URLRequest(url: URL(string: "https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue("Bearer zyraxon", forHTTPHeaderField: "Authorization")
request.httpBody = try JSONSerialization.data(withJSONObject: [
    "model": "zyraxon-codex",
    "messages": [["role": "user", "content": "Plan my day."]],
])

let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8) ?? "")

Voice on a phone

Record on the device, POST the file to the speech endpoint, then send the transcript as an ordinary text turn. This is more reliable than sending audio to a model that may not accept it.

bash
curl -s https://zyraxonai.lovable.app/api/public/stt \
  -F "file=@recording.mp3" \
  -F "language=en" | jq -r '.text'

Notes

  • ▸CORS allows any origin, so a WebView-based app can call the endpoint directly.
  • ▸For voice on mobile, POST the recording to /api/public/stt and send the transcript as a normal text turn.
  • ▸Keep large media off the device path: compress on the phone first, then send one or two parts.