Languages and Runtimes
Go, Rust, PHP, Java and .NET call the endpoint with the standard library — no client package required.
Not every service wants an SDK dependency. The endpoint is HTTPS and JSON, so the standard library of every mainstream language is enough. Each snippet below is a complete, runnable request.
ℹ
The same three values everywhere
URL
https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions, header Authorization: Bearer zyraxon, and a JSON body carrying model and messages.Go
go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
body, _ := json.Marshal(map[string]any{
"model": "zyraxon-codex",
"messages": []map[string]string{
{"role": "user", "content": "Plan my day."},
},
})
req, _ := http.NewRequest("POST", "https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer zyraxon")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}Rust
rust
// reqwest + serde_json. No OpenAI crate needed.
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = serde_json::json!({
"model": "zyraxon-codex",
"messages": [{ "role": "user", "content": "Plan my day." }]
});
let res = reqwest::Client::new()
.post("https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer zyraxon")
.json(&body)
.send()
.await?
.text()
.await?;
println!("{}", res);
Ok(())
}PHP
php
<?php
// Plain cURL, so it works from any PHP app, Laravel job or WordPress plugin.
$payload = json_encode([
"model" => "zyraxon-codex",
"messages" => [["role" => "user", "content" => "Plan my day."]],
]);
$ch = curl_init("https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Authorization: Bearer zyraxon",
],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);
curl_close($ch);Java and the JVM
java
// Java 11+ HttpClient. Works from Spring Boot, Android or a CLI tool.
var payload = """
{"model":"zyraxon-codex","messages":[{"role":"user","content":"Plan my day."}]}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer zyraxon")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());.NET and C#
csharp
// C# / .NET. The Azure OpenAI client and the OpenAI .NET SDK both take a custom endpoint.
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer zyraxon");
var json = """
{"model":"zyraxon-codex","messages":[{"role":"user","content":"Plan my day."}]}
""";
var res = await http.PostAsync(
"https://zyraxonai.lovable.app/api/public/zyraxon/v1/chat/completions",
new StringContent(json, System.Text.Encoding.UTF8, "application/json"));
Console.WriteLine(await res.Content.ReadAsStringAsync());★
Streaming in any language
Set
"stream": true and read the response as it arrives — the frames are standard server-sent events, so any language with an SSE or line reader can consume them.