Integrations

Uncensored LLM API for Rust

Call the OpenAI-compatible /v1/chat/completions endpoint from Rust using reqwest.

Updated 2026-08-04

Use reqwest to post chat completions to the abliteration.ai OpenAI-compatible endpoint.

use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let client = Client::new();
  let resp = client
    .post("https://api.abliteration.ai/v1/chat/completions")
    .bearer_auth(std::env::var("ABLIT_KEY")?)
    .json(&json!({
      "model": "abliterated-model",
      "messages": [{ "role": "user", "content": "Hello from Rust." }]
    }))
    .send()
    .await?;

  let body = resp.text().await?;
  println!("{}", body);
  Ok(())
}
FAQ

Frequently asked questions.

How do I fix a 401 Unauthorized error from abliteration.ai?

Check that your API key is set and sent as a Bearer token.

How do I fix a 404 Not Found error from abliteration.ai?

Make sure the base URL ends with /v1 and you call /chat/completions.

How do I fix a 400 Bad Request error from abliteration.ai?

Verify the model id and that messages are an array of { role, content } objects.

How do I fix a 429 Rate limit error from abliteration.ai?

Back off and retry. Use the Retry-After header for pacing.