diff --git a/docs/advanced/configuration.mdx b/docs/advanced/configuration.mdx index f96c729c..becbc7eb 100644 --- a/docs/advanced/configuration.mdx +++ b/docs/advanced/configuration.mdx @@ -23,7 +23,7 @@ flowchart LR As GOModel works out of the box with no configuration files, you can try it in a minute. -TODO: the link to the quick start should be provided here! +Start here: [Quick Start](/getting-started/quickstart) diff --git a/docs/docs.json b/docs/docs.json index e6e6262d..e6092f35 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -7,6 +7,14 @@ }, "navigation": { "pages": [ + { + "group": "Getting Started", + "pages": ["getting-started/quickstart"] + }, + { + "group": "Guides", + "pages": ["guides/openclaw"] + }, { "group": "Advanced", "pages": ["advanced/configuration", "advanced/guardrails", "advanced/admin-endpoints"] diff --git a/docs/getting-started/images/audit-logs.png b/docs/getting-started/images/audit-logs.png new file mode 100644 index 00000000..e0b15801 Binary files /dev/null and b/docs/getting-started/images/audit-logs.png differ diff --git a/docs/getting-started/images/usage-analytics.png b/docs/getting-started/images/usage-analytics.png new file mode 100644 index 00000000..c4658276 Binary files /dev/null and b/docs/getting-started/images/usage-analytics.png differ diff --git a/docs/getting-started/quickstart.mdx b/docs/getting-started/quickstart.mdx new file mode 100644 index 00000000..b9971b22 --- /dev/null +++ b/docs/getting-started/quickstart.mdx @@ -0,0 +1,71 @@ +--- +title: "Quick Start" +description: "Run GOModel in about 30 seconds, send your first request, and open the admin panel." +--- + +## Run GOModel in 30 Seconds + +### 1. Start GOModel + +```bash +docker run --rm -p 8080:8080 \ + -e GOMODEL_MASTER_KEY="change-me" \ + -e OPENAI_API_KEY="sk-..." \ + enterpilot/gomodel +``` + + + Set at least one provider credential (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, + `GEMINI_API_KEY`, etc.) or GOModel will have no models to route. + + +### 2. Send your first request + +```bash +curl http://localhost:8080/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer change-me" \ + -d '{ + "model": "gpt-4o-mini", + "messages": [{"role": "user", "content": "Say hello in one sentence."}] + }' +``` + +### 3. Open the Admin Panel + +Open this URL in your browser: + +`http://localhost:8080/admin/dashboard` + + + Dashboard UI is enabled by default (`ADMIN_UI_ENABLED=true`). Admin API + endpoints are at `/admin/api/v1/*` and use the same bearer auth as the main + API. + + +## Verify Models + +List currently available models: + +```bash +curl -s http://localhost:8080/v1/models \ + -H "Authorization: Bearer change-me" +``` + +Use one of those model IDs in your requests. + +## Admin Panel Preview + +### Usage Analytics + +![Usage Analytics dashboard](./images/usage-analytics.png) + +### Audit Logs + +![Audit Logs dashboard](./images/audit-logs.png) + +## Next Steps + +- Configure production settings: [Configuration](/advanced/configuration) +- Add request policies: [Guardrails](/advanced/guardrails) +- Connect OpenClaw: [Using GOModel with OpenClaw](/guides/openclaw) diff --git a/docs/guides/openclaw.mdx b/docs/guides/openclaw.mdx new file mode 100644 index 00000000..25e5da73 --- /dev/null +++ b/docs/guides/openclaw.mdx @@ -0,0 +1,89 @@ +--- +title: "Using GOModel with OpenClaw" +description: "Connect OpenClaw to GOModel through an OpenAI-compatible provider config." +--- + +## Overview + +OpenClaw can use GOModel as an OpenAI-compatible backend. + +Flow: + +`OpenClaw -> GOModel -> OpenAI/Anthropic/Gemini/...` + +## 1. Run GOModel + +Start GOModel with at least one provider and a master key: + +```bash +docker run --rm -p 8080:8080 \ + -e GOMODEL_MASTER_KEY="change-me" \ + -e OPENAI_API_KEY="sk-..." \ + enterpilot/gomodel +``` + +Confirm your model list: + +```bash +curl -s http://localhost:8080/v1/models \ + -H "Authorization: Bearer change-me" +``` + +## 2. Add a GOModel provider in OpenClaw + +In your OpenClaw config, add a custom provider that uses OpenAI-compatible requests: + +```json +{ + "env": { + "GOMODEL_MASTER_KEY": "change-me" + }, + "models": { + "mode": "merge", + "providers": { + "gomodel": { + "baseUrl": "http://localhost:8080/v1", + "apiKey": "${GOMODEL_MASTER_KEY}", + "api": "openai-completions", + "models": [ + { + "id": "gpt-4o-mini", + "name": "GOModel gpt-4o-mini", + "reasoning": false, + "input": ["text"], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + } + ] + } + } + }, + "agents": { + "defaults": { + "model": { + "primary": "gomodel/gpt-4o-mini" + } + } + } +} +``` + +Replace `gpt-4o-mini` with any model ID returned by GOModel at `/v1/models`. + +## 3. Validate from OpenClaw + +After reloading OpenClaw, send a test prompt with your configured default model. + +If you get `401 Unauthorized`, verify OpenClaw is sending the same value as `GOMODEL_MASTER_KEY`. + +## Notes + +- If GOModel is running in Docker and OpenClaw is not, `http://localhost:8080` is usually correct. +- If both run in different containers, use a shared Docker network and container hostname instead of `localhost`. +- You can expose multiple GOModel-backed models by adding more entries under `models.providers.gomodel.models`.