LLM Response Formatter

Format raw LLM API JSON responses into clean readable output.

Paste a full LLM API response from OpenAI, Anthropic, or Gemini and instantly extract the message content, token usage, finish reason, and any tool calls — formatted separately and readably. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

Which providers does this support?

It auto-detects OpenAI chat completions, the Anthropic Messages API, and Google Gemini generateContent responses. It looks for the characteristic fields of each — choices for OpenAI, content blocks for Anthropic, and candidates for Gemini — and falls back gracefully if the shape is unfamiliar.

Turn a wall of escaped JSON into a readable answer

When you call an LLM API directly, the response is a deeply nested JSON object with the actual message buried inside, escaped newlines, token usage, finish reasons, and possibly tool calls mixed in. This formatter takes that raw body, detects whether it came from OpenAI, Anthropic, or Gemini, and pulls everything apart into clean, labeled sections so you can read the answer and debug the call.

The anatomy of an LLM API response

Each provider structures its response differently, which is why reading them raw is confusing. Here is what each provider’s top-level shape contains:

OpenAI chat completions wrap the message inside choices[0].message.content, surrounded by id, model, created timestamp, token counts inside usage, and a finish_reason that tells you why generation stopped (stop, length, tool_calls, content_filter).

Anthropic Messages API returns a content array of typed blocks — {"type": "text", "text": "..."} for prose and {"type": "tool_use", ...} for tool invocations. Token counts are in usage.input_tokens and usage.output_tokens. The stop condition is stop_reason.

Gemini generateContent wraps text inside candidates[0].content.parts[0].text and reports token counts in usageMetadata. The stop condition is candidates[0].finishReason.

The formatter handles all three automatically — you do not need to know which provider produced the response before pasting it.

Common debugging scenarios

Checking the finish reason. If your application is getting truncated responses, finish_reason: "length" confirms the output hit the max_tokens cap rather than completing naturally. The fix is to raise the limit or prompt the model to be more concise.

Inspecting tool call arguments. When a model returns a function or tool call, the arguments are often a JSON string nested inside the response JSON — doubly encoded. The formatter extracts and pretty-prints them so you can immediately see whether the model produced valid arguments or a malformed partial object.

Comparing prompt and completion tokens. Token counts per call are the most direct way to spot prompt engineering inefficiency. A prompt using 3,000 tokens and returning 50 is a signal to shorten the system prompt.

How it works

Paste the full JSON response. The tool inspects the top-level shape to identify the provider: OpenAI responses have a choices array, Anthropic responses have a content array of typed blocks, and Gemini responses have candidates. It then extracts the assistant’s text, unescapes the newlines and quotes so the content renders as real paragraphs, and surfaces the token usage and finish reason. Any tool or function calls are isolated and pretty-printed in their own block.

Tips and notes

This is purely a client-side parser — nothing you paste is sent anywhere, so it is safe for sensitive responses. If the JSON does not match a known provider, the tool still shows you the parsed object and any string fields it can find, which is useful for custom gateways or proxied APIs. When debugging structured output, check the tool-call section to confirm the model returned valid JSON arguments; malformed arguments are the most common cause of downstream failures.