hallucinateapi

command module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GitHub release License Active

hallucinateapi

Implements every GET and POST operation in an OpenAPI spec by using each operation's description as the LLM instruction, validating inputs, and returning schema-constrained JSON that behaves like a normal API response.

Features

  • Serves all GET and POST operations from an OpenAPI 3.0 specification
  • Supports multiple LLM providers: Gemini on Vertex AI and OpenAI-compatible APIs
  • Validates requests and responses against the OpenAPI schema
  • Supports --mode two-pass for selecting non-200 OpenAPI response types before generating payloads
  • Swagger UI at / and spec served at /openapi.json or /openapi.yaml
  • Configuration via environment variables and CLI flags
  • Built-in spec validation with validate subcommand

Quick Start

# Validate your OpenAPI spec (Gemini)
hallucinate validate --provider gemini --openapi-path spec.yaml --gcp-project my-project --gcp-location us-central1 --model gemini-2.5-flash

# Start the server (Gemini)
hallucinate serve --provider gemini --openapi-path spec.yaml --gcp-project my-project --gcp-location us-central1 --model gemini-2.5-flash

# Start the server (OpenAI)
hallucinate serve --provider openai --openapi-path spec.yaml --model gpt-4o --api-key your-api-key

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
llm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL