What problem does it solve?
MoonBit has no AI-specific libraries, so developers building Golem agents in MoonBit lack a clear path to add LLM chat, embeddings, or other AI capabilities. This Skill provides working patterns for calling LLM provider REST APIs directly via WASI HTTP from MoonBit agents.
Core Features & Use Cases
- Direct LLM API Calls: Complete MoonBit code for calling the OpenAI Chat Completions API using WASI HTTP outgoing requests.
- Multi-Provider Reference Table: Authority, path, and auth header details for OpenAI, Anthropic, Google Gemini, Groq, and Mistral.
- Secret Management: Guidance on storing API keys as typed secrets with Golem's config system and the golem CLI.
- Use Case: Build a stateful chat agent in MoonBit that maintains conversation history across turns and answers user questions through an HTTP endpoint backed by GPT-4o.
Quick Start
Add an LLM chat endpoint to my MoonBit Golem agent that calls the OpenAI API using an API key stored as a Golem secret.