Skip to main content
Geni ships with a single configuration file that controls everything from API metadata and route discovery to security schemes, documentation routing, and MCP server behaviour. Before customising any option, publish the default file into your project’s config directory so Laravel loads your local copy instead of the package default.
The file is written to config/geni.php. Every key shown in this reference corresponds directly to a key in that file.

Document Information (info)

The info block defines the top-level metadata that appears in the OpenAPI info object and in the rendered documentation UI.

Route Discovery

These options tell Geni which routes to include in the generated specification. By default, Geni discovers every route whose URI starts with the api_path prefix.
When routes is set, Geni ignores api_path and api_domain for route filtering. The closure has full access to the route collection, so you can combine path, domain, name, and middleware checks in a single place.

Database Migrations

Geni replays your migration history offline to derive column types for Eloquent model schemas — no live database connection required.

Schema Overrides

When Geni cannot infer a column type from your migrations — for example, because a migration uses a raw SQL expression or a database-specific column type — you can supply the correct type manually.
Each key is a table.column string. The value is any valid JSON Schema primitive type: string, number, integer, boolean, object, or array.
Treat schema_overrides as an escape hatch, not a first resort. If Geni misses a type that it should be able to infer, check geni:analyze output first — there may be a migration pattern you can simplify so that static analysis picks it up automatically.

Security Schemes

Geni inspects route middleware to determine which endpoints require authentication and which OpenAPI security scheme to attach to them.
The middleware_security_schemes map lets you emit different security requirements for different auth guards. The auth:sanctum entry above produces a sanctumAuth bearer scheme, while auth:api-key produces an apiKeyAuth API key scheme — each appearing in the correct securitySchemes component and referenced from the appropriate endpoint.

Documentation Routing

These options control the URLs where Geni serves the documentation UI and the raw OpenAPI JSON, as well as who can access them.
restrict_to_local defaults to true. If you want to expose documentation in staging or production, set this to false and protect the routes using the middleware array and/or docs_auth credentials instead.

Documentation Authentication

When you need to gate access to the documentation UI with a login prompt, configure docs_auth. Geni supports both HTTP Basic authentication and a simple HTML form login.
Store your credentials in .env rather than hard-coding them in config/geni.php. The env() defaults shown above mean you can set GENI_DOCS_USERNAME and GENI_DOCS_PASSWORD per environment without touching the config file.

Multi-Version APIs

The apis key lets you define multiple independent API surfaces — each with its own route prefix, title, version string, and any other top-level configuration option — within a single Laravel application.
Each key (v1, v2) becomes the --api name accepted by every geni:* Artisan command. Any top-level configuration option can be overridden inside an API entry — options not specified in the entry fall back to the root-level value.
Use geni:export --api=v1 and geni:export --api=v2 in your CI pipeline to produce separate committed spec files for each version. Use geni:check --api=v1 and geni:check --api=v2 independently to detect drift in either version.

Model Context Protocol

The mcp block configures Geni’s MCP server — the component that exposes your API as callable tools to AI desktop clients. Enable it, define which routes to surface, and configure authentication for outbound HTTP execution requests.
Set GENI_MCP_BEARER_TOKEN or GENI_MCP_API_KEY in your .env file — not directly in config/geni.php — to avoid committing credentials. These values are forwarded by the MCP server when it proxies tool calls to your application on behalf of an AI client.