Skip to content
open.blog documentation
open.blog

Assistant provider APIs

Research date: 2026-10-23

Summary#

open.blog can add native server-side adapters for OpenAI, Google Gemini, xAI Grok, DeepSeek, Mistral, and OpenRouter. All six accept API-key authentication and can return JSON, but only five provide a direct, provider-controlled JSON Schema mode. OpenRouter forwards structured-output requests only to compatible upstream endpoints and explicitly warns that strict enforcement varies by provider.

GitHub should not appear beside those providers. GitHub Models was fully retired on 2026-07-30, including its inference API. GitHub Copilot instead offers an agent-oriented SDK that runs through Copilot CLI and GitHub authentication; it is not a simple hosted completion endpoint with an API key. That could become a distinct desktop/agent integration, but it does not fit open.blog's current native provider contract.

Admin labelDefault model candidateEndpointCredential variableStructured result
OpenAIgpt-6-lunaPOST https://api.openai.com/v1/responsesOPENAI_API_KEYNative JSON Schema
Google Geminigemini-3.8-flashPOST https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContentGEMINI_API_KEYNative JSON Schema
xAI Grokgrok-4.7POST https://api.x.ai/v1/responsesXAI_API_KEYNative JSON Schema
DeepSeekdeepseek-flashPOST https://api.deepseek.com/responsesDEEPSEEK_API_KEYNative JSON Schema
Mistral AImistral-small-latestPOST https://api.mistral.ai/v1/chat/completionsMISTRAL_API_KEYNative JSON Schema
OpenRouterno hard-coded model; require selectionPOST https://openrouter.ai/api/v1/chat/completionsOPENROUTER_API_KEYRouted JSON Schema; endpoint-dependent

Keep Custom HTTPS and the existing Anthropic Claude adapter. Use provider names in the dropdown: “OpenAI” is more accurate than “ChatGPT/Codex,” because ChatGPT and Codex are product experiences while this integration uses the OpenAI API and a general text model.

Verified API contracts#

OpenAI#

  • The Responses endpoint is POST https://api.openai.com/v1/responses and authenticates with Authorization: Bearer $OPENAI_API_KEY (create response, authentication).
  • Structured output belongs at text.format = {"type":"json_schema","name":"...","schema":{...},"strict":true}. The API guarantees schema adherence for supported models, subject to documented refusal and incomplete-response cases (structured outputs).
  • Extract the JSON string from the output item whose type is message, then its content item whose type is output_text; SDK output_text helpers merely aggregate those items (Responses example).
  • OpenAI currently presents Astra, Sol, and Luna as its main model tiers; Luna is described as the efficient choice for focused, high-volume work. gpt-6-luna is therefore the most proportionate default for repeated blog review, while the model field should remain editable (model selection).

Google Gemini#

  • The direct content endpoint is POST https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent. Requests authenticate with the x-goog-api-key header; Google advises that production browser clients should call through a backend so the key is not exposed (API reference, API-key security).
  • For generateContent, structured output is configured in the generation configuration as JSON output plus a JSON Schema. The current REST documentation uses generationConfig.responseFormat.text.mimeType = "APPLICATION_JSON" and a schema; Gemini supports a documented subset of JSON Schema and still requires application-side semantic validation (structured outputs, generation configuration).
  • Extract text from candidates[0].content.parts[*].text. The standard response is a GenerateContentResponse containing candidates, each with content and parts (text generation response).
  • gemini-3.8-flash is the current stable Flash identifier and Google recommends current Flash models for new projects (models, 2026 release notes).

xAI Grok#

  • The Responses endpoint is POST https://api.x.ai/v1/responses, authenticated with Authorization: Bearer $XAI_API_KEY; the current official example uses grok-4.7 (Responses API, API overview).
  • Structured output uses the OpenAI Responses shape: text.format = {"type":"json_schema","name":"...","schema":{...},"strict":true}. xAI says supported schema features are guaranteed (structured outputs).
  • Extract the text from the output item with type: "message", then the content item with type: "output_text"; reasoning may appear as a separate output item and must not be parsed as the result (Responses response object, structured-output extraction example).

DeepSeek#

  • DeepSeek's OpenAI-format base URL is https://api.deepseek.com; authentication is HTTP Bearer. The native Responses call is POST /responses (authentication, Responses API).
  • The current model identifiers are deepseek-flash and deepseek-v4-pro. Flash is the lower-cost, high-throughput candidate and supports the Responses API (models and pricing, list models).
  • The Responses API supports text.format = {"type":"json_schema","name":"...","schema":{...}} as well as plain JSON mode. Extract the result from output[] message items and their output_text content; reasoning is a separate item (Responses request and response).
  • The older Chat Completions JSON mode guarantees valid JSON but not schema adherence and may occasionally return empty content. Prefer Responses JSON Schema mode for open.blog (JSON output).

Mistral AI#

  • Chat completions use POST https://api.mistral.ai/v1/chat/completions with Authorization: Bearer $MISTRAL_API_KEY (chat API, first API request).
  • response_format.type = "json_schema" guarantees JSON following the supplied schema. The raw result is choices[0].message.content (chat API response format, custom structured outputs).
  • mistral-small-latest is documented as the fast, cost-effective general model. The editable model field lets users choose mistral-medium-latest or a pinned version when quality or reproducibility matters. Mistral warns that -latest aliases may receive silent model and pricing changes (model choices, model lifecycle).

OpenRouter#

  • Chat completions use POST https://openrouter.ai/api/v1/chat/completions and Bearer authentication. HTTP-Referer and X-Title are optional attribution headers. A normal response returns text in choices[0].message.content (chat completion reference, developer quickstart).
  • Structured output uses the OpenAI Chat Completions response_format.json_schema shape. Support is determined per upstream endpoint, can change, and strict enforcement varies by provider. Send provider.require_parameters: true so routing is restricted to endpoints that accept the requested schema (structured outputs).
  • Do not hard-code a default model slug. OpenRouter is valuable precisely as a model router; its model catalog exposes current models and filtering, while model availability and endpoint capabilities change independently (models API).

GitHub Copilot and GitHub Models#

  • GitHub Models is not available: GitHub states that its playground, model catalog, inference API, and BYOK support were fully retired on 2026-07-30. GitHub also states that Models was separate from Copilot (GitHub Models retirement).
  • GitHub's supported programmatic path is the Copilot SDK. It embeds the Copilot CLI agent runtime, communicates with it over JSON-RPC, and authenticates through an interactive signed-in user, GitHub OAuth App, GitHub tokens, server-to-server organization policy, or BYOK. Standard Copilot-backed use requires a Copilot subscription (Copilot SDK repository, Copilot SDK authentication).
  • GitHub's REST Copilot endpoints manage seats, policies, agents, and usage; they are not a general text-inference API (Copilot REST endpoints).

Engineering recommendations#

These are recommendations, not provider claims:

  1. Implement one shared OpenAI Responses-compatible adapter for OpenAI, xAI, and DeepSeek, parameterized by fixed origin, credential name, and safe public error label. Keep each provider as a distinct enum value so credentials remain destination-bound.
  2. Implement dedicated Gemini and Mistral adapters because their request and response envelopes differ.
  3. Implement OpenRouter through Chat Completions and set provider.require_parameters to true. Clearly label it as a routed third-party service and require an explicit model.
  4. Preserve the existing post-response semantic validators. Schema conformance guarantees shape, not correct evidence offsets, grounded claims, or appropriate review findings.
  5. Store provider credentials only in the existing server-side credential store or provider-specific environment variables. Never return keys to Admin or persist them in openblog.json.
  6. Fetch provider model lists only as a later enhancement. The first version should offer an editable model field with a documented default; live catalogs add network, caching, authentication, and model-capability reconciliation work.
  7. Exclude GitHub from this release. If demand emerges, design a separate “Copilot SDK” integration around GitHub OAuth, subscription/organization policy, CLI lifecycle, and agent permissions rather than pretending it is another API-key provider.

View this page's source