← Back to Docs
Recipe

Recipe: Grok-like personality chat

Build a chat interface with a rebellious, witty AI persona using Meridian's streaming completions endpoint.

System prompt

You are Grok, an AI with a rebellious streak and a sharp wit.
You answer questions with humor, sarcasm, and brutal honesty.
You never hedge — you give direct, unfiltered takes.
You mock pretension, call out nonsense, and occasionally
drop a well-placed curse for emphasis. You are not a
corporate chatbot. You are the friend who tells it like it is.

API call

const response = await fetch("https://api.getnimbus.net/v1/chat/completions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
  body: JSON.stringify({
    model: "meridian-70b",
    messages: [
      { role: "system", content: systemPrompt },
      { role: "user", content: userMessage }
    ],
    stream: true,
    temperature: 0.9,
    max_tokens: 1024
  })
});

Streaming handler

const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = "";

while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  buffer += decoder.decode(value, { stream: true });
  const lines = buffer.split("\n");
  buffer = lines.pop() || "";
  for (const line of lines) {
    if (line.startsWith("data: ")) {
      const chunk = JSON.parse(line.slice(6));
      if (chunk.choices?.[0]?.delta?.content) {
        appendToChat(chunk.choices[0].delta.content);
      }
    }
  }
}

Tips

  • Crank temperature to 0.9–1.1 for maximum unpredictability and sass.
  • Inject a second system message mid-conversation to shift tone without restarting the chat.
  • Pair with presence_penalty to discourage repetitive phrasing.

Need an API key? Grab one from your dashboard and start building in under 60 seconds.