API Besaz Documentation

A practical guide to defining, generating, reviewing, and using FastAPI backend projects with API Besaz.

API Besaz is a configuration-driven backend generator. Your configuration covers project settings, database, entities, APIs, security, background tasks, observability, tests, and deployment if needed. The engine validates that definition and renders files for the selected options. The result is a downloadable backend project—not a replacement for every part of building a product.

The output is a standalone project. The output is an independent project whose code you can inspect. API Besaz prepares the backend and API layer; you can connect it to a frontend, mobile app, no-code tool, or workflow built with help from an AI agent. Review the code and settings before release.

Quick start: find your path in a few steps

  1. Create an account Create an account, then check the initial free credit and token balance in your dashboard.
  2. Open the Builder Set the project name and Python version.
  3. Add entities Define entities (such as Product or Order), their fields, relationships, and the API routes you need.
  4. Toggle features Enable optional modules with their dependencies in mind.
  5. Generate Review the configuration summary and cost, submit generation, then download and test the ZIP archive.

Guided example: a small inventory API

Use this walkthrough to understand how the Builder choices fit together. The inventory domain is only an example; choose names and fields that match your own application.

1

1. Name the project

Open Builder and choose a clear project name such as inventory_api. Use a supported Python major/minor version and keep the package name simple (letters, digits, and underscores are easiest to work with).

2

2. Define the data

Create a Category entity with an id and a name. Create a Product entity with an id, name, price (decimal), and stock (integer). Add only fields your API actually needs, and review required/default and min/max constraints before continuing.

3

3. Connect related entities

If each product belongs to one category, define a many_to_one relationship from Product to Category. Read the relationship direction in the Builder carefully; an incorrect direction can produce a valid but different data model than the one you intended.

4

4. Choose collection endpoints

Add REST collection paths for products and categories and select the HTTP methods you need. Define collection paths without manually adding /{id}; the engine creates item-level paths according to its generation rules. Review the final endpoint summary before generating.

5

5. Enable only required modules

Enable authentication, admin, caching, WebSockets, GraphQL, background tasks, tests, observability, or Docker files only when you need them. Some options depend on other modules, so resolve any validation message rather than trying to bypass it.

6

6. Validate, estimate, generate, and review

Read every validation message, check the server-calculated token cost, and submit generation. When the job completes, download and extract the ZIP. Start with the generated README and environment example, then inspect migrations, routes, and tests before connecting real services or deploying.

What should the ZIP contain?

The exact files depend on your configuration. A typical output includes an application package plus dependency and configuration files; selected features may add authentication, migrations, tests, and deployment assets. API Besaz generates backend code, not a complete user-facing frontend for your application.

  • Application code: models, schemas, services, and API routes selected by the Blueprint.
  • Quality assets: generated tests and migration files when supported by the selected entities and options.
  • Run/deploy guidance: README and environment or Docker files when their options are enabled.

How does API Besaz fit with other tools?

These tools are not necessarily substitutes. The right combination depends on the problem; API Besaz focuses on defining and generating the backend layer.

AI agents

Useful for research, architecture suggestions, writing or changing code, troubleshooting, and automating development tasks. Agent output still needs review and testing.

No-code / low-code tools

Useful for quickly building interfaces, forms, internal apps, and workflows. When a product needs a custom backend or independent API, the no-code app can consume the generated API.

API Besaz

Lets you define backend data models, relationships, routes, and modules in an explicit configuration, then download a FastAPI project you control.

A practical combination Generate a backend foundation with API Besaz, connect it to your no-code interface or frontend, then use an agent and human review as needed to extend, test, and maintain the project.

The Builder

These settings are passed to the generation engine. Some options depend on validation rules and module dependencies in the configuration model:

  • Project — project name, Python major/minor version, and the pip package manager.
  • Database — PostgreSQL or SQLite with SQLModel; Redis caching is optional.
  • Features — modules such as authentication, admin, GraphQL, WebSockets, background tasks, observability, and deployment.
  • Entities & Endpoints — entities, typed fields, relationships, and REST endpoints.

Review the final cost in the Token Cost panel before generating. Cost depends on enabled options and entity count; the browser estimate is informational and the server recalculates the charge.

Fields & Types

Each entity is made of typed fields. The engine validates supported options and constraints for each field type; check the Builder for the exact controls available.

TypePython typeConstraints
stringstrmin_length, max_length, pattern
textstrmin_length, max_length, pattern
integerintmin_value, max_value
floatfloatmin_value, max_value
decimalDecimalmin_value, max_value
booleanbool—
datedate—
datetimedatetime—
uuidUUID—
enumEnumchoices (required)
jsondict—
Tip: Use field names and enum values accepted by the Builder. Constraints differ by type, and a required field cannot have a non-null default.

Relationships

Relationships are defined in your configuration. The engine creates foreign keys or link tables based on the relationship type and validates incompatible definitions.

TypeMeaningExample
many_to_oneMany children → one parentMany orders → one customer
one_to_manyOne parent → many childrenOne customer → many orders
many_to_manyMany ↔ many (link table)Posts ↔ tags
one_to_oneExactly one ↔ oneUser ↔ profile

Endpoints

For REST endpoints, choose the entity, collection path, and allowed HTTP methods in the configuration. The engine adds item-level paths according to its generation rules.

  • Methods: get, post, put, patch, delete
  • Define collection paths without {id} — API Besaz adds /{id} for item-level operations automatically.

Feature Reference

REST API

Generates routers and API operations from your configured endpoints and entities. REST is enabled by default in the configuration model.

Authentication

When enabled, the project includes JWT authentication, session management, and TOTP components. Authentication requires REST and GeoIP to be enabled.

Admin panel

The SQLAdmin interface is optional and, according to engine validation, can only be used when authentication is enabled too.

GraphQL

When enabled with Strawberry selected, GraphQL schema and resolvers are generated alongside the other APIs. This feature requires authentication.

WebSockets

Real-time connections are optional. With authentication enabled, connections use a single-use ticket; without authentication, the connection is anonymous.

Redis cache

Caching can be enabled optionally. The generated project is configured to connect to Redis and needs a reachable Redis service at runtime.

Background tasks

When enabled, RabbitMQ connection code and the components required for broker-backed background work are generated.

Observability

Logging and metrics components are generated according to the configuration. Dashboards and supporting services depend on deployment settings.

Docker deployment

Docker, Compose, and Nginx assets are generated only when deployment is enabled. Configure TLS at the deployment layer before exposing the app publicly.

Pytest and Locust

Pytest files are derived from entities, endpoints, and enabled modules. Locust generation is independent of pytest; the test count varies by project definition.

Security, quality and performance

Security and maintainability are built into the API Besaz workflow: validated configuration, typed schemas, blueprint-defined ownership and writable-field rules, generated tests, and deployment guidance give you a concrete backend foundation to inspect and extend. The platform has been assessed with established security tools and manual checks, so you can continue development from a tested starting point rather than a blank scaffold.

Defense in depth

The engine validates project configuration before generation. Blueprint-defined resources can generate typed schemas and constraints, per-user ownership checks, role-aware access rules, and restrictions on which fields clients may write. When ownership, roles, and writable fields are defined correctly, these controls are designed to prevent common IDOR and mass-assignment paths in generated routes. Defense in depth means these layers reinforce one another; custom routes, altered authorization logic, or incorrect configuration still require review.

Multiple security assessment methods

API Besaz has been tested with CodeQL static analysis, OWASP ZAP web/API scanning, and OpenVAS infrastructure assessment, alongside manual security checks. The reported scanner findings were reviewed and classified as false positives within the tested scope; the assessed build passed those checks after review. This is meaningful test evidence for the evaluated version and configuration—not a claim that untested application-specific code can never contain a vulnerability.

Manual access-control checks

Manual checks covered IDOR/broken access control and Mass Assignment. The included internal report records 29 passing probes, zero failures, and two not-applicable cases caused by test-request or route mismatches. For blueprint-defined resources, correctly configured ownership rules scope record access, while generated schemas and protected-field handling limit what a client can set or change. These protections apply to the generated routes and configuration that were tested; custom endpoints and business rules need their own authorization and input-validation tests.

Load testing and realistic expectations

Load testing reached up to 2,500 requests per second in the tested setup. Locust scenario support can also be included in generated projects when enabled. The result demonstrates useful throughput under that workload and environment; actual capacity depends on endpoint behavior, database queries, hardware, worker/replica count, network conditions, and configuration. Before production, measure throughput together with P50/P95/P99 latency and error rate under your own representative workload.

Inspectable code and control over the result

The generated backend is delivered as a downloadable project that you can inspect, modify, test, version-control and deploy using your preferred development workflow. API Besaz reduces repetitive backend scaffolding; it does not require the generated application to call API Besaz at runtime. You still own the architecture decisions, integrations, security review and ongoing maintenance.

Diagnose issues with observability

When enabled, generated projects can include structured logs, request IDs, Prometheus metrics and health/readiness endpoints, with Grafana, Loki and related deployment assets according to configuration. Use these signals to measure real latency, errors and saturation rather than relying on a headline requests-per-second number.

Important: The security and load-test results provide a concrete, tested foundation for continuing development. Still, API Besaz cannot predict every business rule, custom integration, deployment choice, or implementation scenario introduced during later development. You remain responsible for reviewing generated and custom code, configuring ownership and permissions correctly, protecting secrets and infrastructure, testing realistic workflows, and reassessing changes before production. Treat the test results as evidence for the scope that was tested—not as a promise of absolute security for every possible application.

Before production

  • Read the generated README and environment example; store secrets outside source control and rotate any credential that was exposed.
  • Put the application behind HTTPS/TLS, configure strict allowed origins, and enable the authentication and authorization modules appropriate to your use case.
  • Keep administration, monitoring, metrics, object storage, queues and secret-management interfaces private unless a protected access path is deliberately configured.
  • Apply reviewed database migrations, configure backups, and test that backups can actually be restored.
  • Run generated pytest tests, dependency/container scans, and manual IDOR, mass-assignment, ownership, and permission checks against a staging deployment; include a representative Locust workload.
  • Record throughput together with P50/P95/P99 latency, failure rate, hardware, worker/replica count, request mix and test duration; repeat after significant code or infrastructure changes.

External resources for generated projects

GeoLite2 is included by default in generated project ZIPs when GeoIP is enabled. Grafana plugins are not included in project ZIPs; download a compatible plugin bundle and the latest GeoLite2 database from the Downloads page.

Grafana datasource plugins (Loki and Prometheus)

Grafana plugin files are not bundled in generated project ZIPs. Download the compatible Loki and Prometheus plugin bundle from the Downloads page when it is listed, then extract the files to grafana/plugins/loki/ and grafana/plugins/prometheus/ respectively. If the combined bundle is not listed, use the official links below. open Downloads. Grafana's official plugin installation guide.

IP-to-country lookup (GeoLite2 Country)

When GeoIP is enabled, the GeoLite2-Country.mmdb database is included in the generated project ZIP by default at the path below. To refresh an existing project, download the latest database from the Downloads page and replace that file. Without the database, country lookup falls back to Unknown. IP geolocation is approximate and must not be treated as a precise address. open Downloads.

app/geoip/GeoLite2-Country.mmdb Get GeoLite2 from MaxMind

Tokens & Pricing

Generation cost is not the same for every project. It depends on core settings, enabled modules, and entities; the Builder estimate shows the configured cost before you submit a generation request.

  • New accounts currently start with 25 free tokens.
  • Buy more anytime on the Pricing page.
  • The server calculates the final charge; treat the browser estimate as informational, not the final billing authority.

See Pricing for current bundles.

Common problems and what to check

Use the specific validation or job message first. Avoid posting passwords, tokens, private configuration, or environment files when asking for help.

The Builder says the configuration is invalid

Open the validation summary and fix the first reported issue, then validate again. Check entity and field names, supported field types, enum choices, relationship targets, and endpoint paths. A configuration must meet the engine's structural requirements before generation can start.

A feature or file is missing from the ZIP

Optional features are generated only when selected and compatible with the rest of the Blueprint. Check the feature toggles and dependency messages. A deployment file will not appear if the corresponding deployment option was not enabled.

Generation is still queued or failed

Check the project status before submitting another request to avoid duplicate work. If the status remains stuck or fails repeatedly, save the project/job identifier and the non-sensitive error message, then contact support. Queue and worker availability can affect completion time.

The download link no longer works

Generated download links are time-limited. Return to your project/dashboard and request a fresh download when that action is available. If the project is no longer listed, contact support with its identifier; do not share signed download URLs publicly.

The generated project does not start or tests fail

Extract the ZIP and read its README first. Install the declared dependencies, create local environment settings from the example without committing secrets, configure a reachable database and any enabled services, and run migrations before the test suite. Generated code is a starting point: review test failures, security settings, permissions, and production deployment choices before launch.

FAQ

Do I own the generated code?

The generated files are provided for you to review and change. You must also follow the licenses of dependencies and any license files included in the output.

Can I use SQLite for production?

Both database options are supported in the configuration. The right choice depends on workload, concurrency, backups, and operational requirements.

What if I run out of tokens mid-design?

Review the cost shown in the Builder before generating. If your balance is insufficient, add tokens first; check the dashboard for the status of any saved project configuration.

Is the Admin Panel separate from Auth?

Admin is an add-on that requires the Auth Package — users need to log in to reach the admin panel.