Skip to content

docs(mintlify): add SDK examples alongside curl - #669

Merged
SantiagoDePolonia merged 1 commit into
mainfrom
docs/code-sdk
Aug 8, 2026
Merged

SantiagoDePolonia merged 1 commit into
mainfrom
docs/code-sdk

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add Python and JavaScript SDK tabs alongside 54 existing cURL request examples
  • use typed OpenAI and Anthropic SDK methods for compatible endpoints
  • use the OpenAI SDK raw request interface for GoModel-specific admin, usage, passthrough, and metrics routes
  • keep installer cURL commands shell-only and update cURL-only guide headings

Validation

  • mint validate
  • mint broken-links
  • embedded Python syntax checks
  • embedded JavaScript syntax checks
  • current Python and JavaScript SDK interface checks
  • repository pre-commit hooks

Summary by CodeRabbit

  • Documentation
    • Added Python and JavaScript examples alongside existing Bash/cURL examples across API, provider, admin, and integration guides.
    • Grouped multi-language examples into selectable code tabs for easier comparison and copying.
    • Expanded examples covering authentication, usage, budgets, rate limits, workflows, conversations, audio, responses, metrics, and provider integrations.
    • Updated verification instructions to demonstrate equivalent SDK-based requests and response handling.

@mintlify

mintlify Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gomodel 🟢 Ready View Preview Aug 8, 2026, 8:12 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR expands documentation examples across advanced APIs, features, guides, and providers. Existing cURL or Bash examples are grouped with equivalent Python and JavaScript client examples.

Changes

Advanced API examples

Layer / File(s) Summary
Advanced API example coverage
docs/advanced/*.mdx
Administration, messaging, audio, conversations, responses, usage, and workflow examples now include grouped Bash, Python, and JavaScript variants.

Feature API examples

Layer / File(s) Summary
Feature endpoint examples
docs/features/*.mdx
Budget, labelled key, rate-limit, and user-path usage examples now include Python and JavaScript clients alongside existing cURL examples.

Guide verification examples

Layer / File(s) Summary
Guide verification flows
docs/guides/*.mdx
Integration guides now use grouped cURL, Python, and JavaScript verification examples. Metrics examples also cover enabled and disabled endpoints.

Provider examples

Layer / File(s) Summary
Provider verification and passthrough examples
docs/providers/*.mdx
Provider pages now include grouped Python and JavaScript OpenAI-compatible examples for chat, Responses, audio, embeddings, tokenization, and passthrough routes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • ENTERPILOT/GoModel#170: Introduces the Oracle provider and its configuration documentation referenced by the Oracle examples.
  • ENTERPILOT/GoModel#362: Introduces the audio endpoints documented with new multilingual examples.

Poem

A rabbit tabs Bash, Python, JS,
Through API docs in neat finesse.
Curls remain, while clients grow,
New examples hop in a row.
Documentation shines bright—
Three languages make it right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding SDK examples alongside existing cURL examples.
Description check ✅ Passed The description explains the changes and validation steps, but uses Summary and Validation headings instead of the required Description heading.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/code-sdk

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/guides/prometheus-metrics.mdx`:
- Around line 172-237: Update all six `/metrics` verification samples in the
Prometheus metrics guide to authenticate with the configured master key via
`GOMODEL_MASTER_KEY`: add the corresponding Authorization header to both curl
examples and use that key instead of `unused` in the Python and JavaScript
OpenAI client examples. Preserve the documented enabled metrics response and
disabled 404 behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5771b3af-3c1f-4b1d-b9c8-237109af6295

📥 Commits

Reviewing files that changed from the base of the PR and between c7eeb8a and 1f3f7a1.

📒 Files selected for processing (28)
  • docs/advanced/admin-endpoints.mdx
  • docs/advanced/anthropic-messages-api.mdx
  • docs/advanced/audio-api.mdx
  • docs/advanced/conversations-api.mdx
  • docs/advanced/responses-api.mdx
  • docs/advanced/usage-api.mdx
  • docs/advanced/workflows.mdx
  • docs/features/budgets.mdx
  • docs/features/labelling.mdx
  • docs/features/rate-limits.mdx
  • docs/features/user-path.mdx
  • docs/guides/claude-code.mdx
  • docs/guides/codex.mdx
  • docs/guides/openai-agents-sdk.mdx
  • docs/guides/openclaw.mdx
  • docs/guides/opencode-and-other-agents.mdx
  • docs/guides/prometheus-metrics.mdx
  • docs/providers/azure.mdx
  • docs/providers/bailian.mdx
  • docs/providers/bedrock-mantle.mdx
  • docs/providers/bedrock.mdx
  • docs/providers/cohere.mdx
  • docs/providers/llmd.mdx
  • docs/providers/minimax.mdx
  • docs/providers/multiple-ollama.mdx
  • docs/providers/oracle.mdx
  • docs/providers/sglang.mdx
  • docs/providers/vllm.mdx

Comment on lines +172 to +237
<CodeGroup>

```bash curl
curl http://localhost:8080/metrics
# Returns Prometheus metrics in text format
```

```python Python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8080", api_key="unused")
metrics = client.get("/metrics", cast_to=str)

print(metrics)
```

```javascript JavaScript
import OpenAI from "openai";

const client = new OpenAI({
baseURL: "http://localhost:8080",
apiKey: "unused",
});

const metrics = await client.get("/metrics");
console.log(metrics);
```

</CodeGroup>

**When Disabled:**

```bash
<CodeGroup>

```bash curl
curl http://localhost:8080/metrics
# Returns 404 Not Found
```

```python Python
from openai import NotFoundError, OpenAI

client = OpenAI(base_url="http://localhost:8080", api_key="unused")

try:
client.get("/metrics", cast_to=str)
except NotFoundError as error:
print(error.status_code) # 404
```

```javascript JavaScript
import OpenAI from "openai";

const client = new OpenAI({
baseURL: "http://localhost:8080",
apiKey: "unused",
});

try {
await client.get("/metrics");
} catch (error) {
console.log(error.status); // 404
}
```

</CodeGroup>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Authenticate every metrics verification request with the master key.

When a master key is configured, /metrics requires it. The curl samples omit the Authorization header. The SDK samples send Bearer unused. These requests return 401 instead of the documented metrics response or 404.

Use GOMODEL_MASTER_KEY in all six samples.

Proposed fix
-curl http://localhost:8080/metrics
+curl http://localhost:8080/metrics \
+  -H "Authorization: Bearer $GOMODEL_MASTER_KEY"

-from openai import OpenAI
+import os
+from openai import OpenAI
...
-client = OpenAI(base_url="http://localhost:8080", api_key="unused")
+client = OpenAI(
+    base_url="http://localhost:8080",
+    api_key=os.environ["GOMODEL_MASTER_KEY"],
+)

-  apiKey: "unused",
+  apiKey: process.env.GOMODEL_MASTER_KEY,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/prometheus-metrics.mdx` around lines 172 - 237, Update all six
`/metrics` verification samples in the Prometheus metrics guide to authenticate
with the configured master key via `GOMODEL_MASTER_KEY`: add the corresponding
Authorization header to both curl examples and use that key instead of `unused`
in the Python and JavaScript OpenAI client examples. Preserve the documented
enabled metrics response and disabled 404 behavior.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The documentation examples tested behave as documented and do not introduce a confirmed regression.

The executed checks covered the primary copy-paste SDK paths and found no independent defects.

Files Needing Attention: No changed file needs corrective action.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the local-capture validation script across Python and JavaScript SDK environments using Python OpenAI 2.53.0, Anthropic 0.121.0, JavaScript OpenAI 7.4.0, and @anthropic-ai/sdk 0.116.0.
  • Exercised typed OpenAI Responses and Conversations calls, raw OpenAI usage and admin requests, Anthropic managed Messages requests, and Anthropic passthrough Messages requests; the capture server observed 26 requests and all wire assertions passed, including support for include[] serialization.
  • Verified the validation script source exists and runs equivalent documented calls.
  • Confirmed the validation run produced a post-run summary showing 26 captured requests with all wire assertions passed and a clean EXIT_CODE of 0.
  • Noted there was no identified bug in the docs; include[] serialization is compatible with the gateway as described by the repository handlers.

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "docs(mintlify): add SDK examples alongsi..." | Re-trigger Greptile

@SantiagoDePolonia
SantiagoDePolonia merged commit 19da323 into main Aug 8, 2026
21 checks passed

This branch was successfully deployed

1 active deployment
staging - docs — 1f3f7a1e Deployed Aug 8, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants