> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/api/rule-solver-api/rule-solver-api-1.md).

# Rule Solver API GAIA (v1)

Solve a rule on GAIA solver and get the result in the same call.

Solver GAIA (v1) is no longer developed, and new features are released only on AERO (v2). We recommend moving to [Rule Solver API v2](/doc/api/rule-solver-api/rule-solver-api.md). See [Rule Solver API Migration](/doc/api/rule-solver-api/solver-version-migration.md) to learn how.

This page describes version 1 (GAIA) of the Rule Solver API. **It remains available for existing integrations.**

{% hint style="success" %}
In version 1.16.0 and newer Rule Flows are solved with this endpoint too. The separate Rule Flow Solver API is deprecated.
{% endhint %}

## Swagger

You can check out these endpoints and call them right away using swagger.

**Swagger UI:** [https://api.decisionrules.io/api/solver/docs](https://api.decisionrules.io/api/solver/docs/)

**Swagger JSON File:** <https://api.decisionrules.io/api/solver/docs/json>

## Solve Rule (v1 Gaia)

> Solves the rule on solver v1 (Gaia). If the \`{ruleVersion}\` parameter is omitted from the path, the last published rule version will be used automatically.

```json
{"openapi":"3.0.3","info":{"title":"DecisionRules Rule Solver API","version":"1.2.0"},"tags":[{"name":"Rule Solver API v1"}],"servers":[{"url":"https://api.decisionrules.io"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Please insert: \"Bearer <SOLVER_API_KEY>\" into Authorization header."}},"parameters":{"ruleId":{"name":"ruleId","in":"path","required":true,"description":"Unique identifier for the rule that is common to all rule versions. Instead of rule ID, it is possible to use a rule alias.","schema":{"type":"string"}},"ruleVersion":{"name":"ruleVersion","in":"path","required":false,"description":"Rule version. If not provided, the latest published version is used.","schema":{"type":"integer"}},"ContentType":{"name":"Content-Type","in":"header","required":false,"description":"The media type of the request body.","schema":{"type":"string"}},"XStrategy":{"name":"X-Strategy","in":"header","required":false,"description":"Execution strategy used to evaluate the rule. See [Execution Strategy](https://docs.decisionrules.io/doc/rules/common-rule-features/execution-strategy).","schema":{"type":"string","enum":["STANDARD","FIRST_MATCH","ARRAY","EVALUATE_ALL"]}},"XLookupMethod":{"name":"X-Lookup-Method","in":"header","required":false,"description":"Lookup method, used only with Lookup Tables.","schema":{"type":"string","enum":["LOOKUP_EXISTS","LOOKUP_VALUE"]}},"XCorrelationId":{"name":"X-Correlation-Id","in":"header","required":false,"description":"Correlation ID, if you'd like to set it manually. If not present, it will be generated automatically and returned in the response.","schema":{"type":"string"}},"XDebug":{"name":"X-Debug","in":"header","required":false,"description":"On-premise deployments only: set to `true` to solve rules with the status pending. On DecisionRules Cloud this header has no effect.","schema":{"type":"string","enum":["true","false"]}},"XAudit":{"name":"X-Audit","in":"header","required":false,"description":"Whether to create and save an audit of the solve.","schema":{"type":"string","enum":["true","false"]}},"XAuditTtl":{"name":"X-Audit-Ttl","in":"header","required":false,"description":"Number of days after which the audit will be deleted. Default is 14 days.","schema":{"type":"string"}}},"requestBodies":{"SolveBody":{"required":true,"description":"Request body containing the input data and solver options.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"JSON object that describes the input json data."},"options":{"type":"object","description":"Object specifying solver options."}}}}}}},"responses":{"Solved":{"description":"OK","headers":{"X-Solver-Version":{"$ref":"#/components/headers/XSolverVersion"},"X-Solver-Engine":{"$ref":"#/components/headers/XSolverEngine"},"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationIdHeader"}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}},"BadRequestV1":{"description":"Bad Request. Returned for an unknown rule or a missing API key.","headers":{"X-Solver-Version":{"$ref":"#/components/headers/XSolverVersionV1"},"X-Solver-Engine":{"$ref":"#/components/headers/XSolverEngineV1"}},"content":{"application/json":{"schema":{"type":"object"}}}},"Unauthorized":{"description":"Authentication failed.","content":{"application/json":{"schema":{"type":"object"}}}}},"headers":{"XSolverVersion":{"description":"Solver version that evaluated the request, errors included.","schema":{"type":"string"}},"XSolverEngine":{"description":"Name of the solver engine that evaluated the request.","schema":{"type":"string"}},"XCorrelationIdHeader":{"description":"Correlation ID of the request.","schema":{"type":"string"}},"XSolverVersionV1":{"description":"Solver version that evaluated the request, errors included.","schema":{"type":"string"}},"XSolverEngineV1":{"description":"Name of the solver engine that evaluated the request.","schema":{"type":"string"}}}},"paths":{"/rule/v1/solve/{ruleId}/{ruleVersion}":{"post":{"tags":["Rule Solver API v1"],"summary":"Solve Rule (v1 Gaia)","description":"Solves the rule on solver v1 (Gaia). If the `{ruleVersion}` parameter is omitted from the path, the last published rule version will be used automatically.","parameters":[{"$ref":"#/components/parameters/ruleId"},{"$ref":"#/components/parameters/ruleVersion"},{"$ref":"#/components/parameters/ContentType"},{"$ref":"#/components/parameters/XStrategy"},{"$ref":"#/components/parameters/XLookupMethod"},{"$ref":"#/components/parameters/XCorrelationId"},{"$ref":"#/components/parameters/XDebug"},{"$ref":"#/components/parameters/XAudit"},{"$ref":"#/components/parameters/XAuditTtl"}],"requestBody":{"$ref":"#/components/requestBodies/SolveBody"},"responses":{"200":{"$ref":"#/components/responses/Solved"},"400":{"$ref":"#/components/responses/BadRequestV1"},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"solveRuleV1"}}}}
```

## Solve Rule

> The original path without a solver version. It runs on solver v1. If the \`{ruleVersion}\` parameter is omitted from the path, the last published rule version will be used automatically.

```json
{"openapi":"3.0.3","info":{"title":"DecisionRules Rule Solver API","version":"1.2.0"},"tags":[{"name":"Rule Solver API v1"}],"servers":[{"url":"https://api.decisionrules.io"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Please insert: \"Bearer <SOLVER_API_KEY>\" into Authorization header."}},"parameters":{"ruleId":{"name":"ruleId","in":"path","required":true,"description":"Unique identifier for the rule that is common to all rule versions. Instead of rule ID, it is possible to use a rule alias.","schema":{"type":"string"}},"ruleVersion":{"name":"ruleVersion","in":"path","required":false,"description":"Rule version. If not provided, the latest published version is used.","schema":{"type":"integer"}},"ContentType":{"name":"Content-Type","in":"header","required":false,"description":"The media type of the request body.","schema":{"type":"string"}},"XStrategy":{"name":"X-Strategy","in":"header","required":false,"description":"Execution strategy used to evaluate the rule. See [Execution Strategy](https://docs.decisionrules.io/doc/rules/common-rule-features/execution-strategy).","schema":{"type":"string","enum":["STANDARD","FIRST_MATCH","ARRAY","EVALUATE_ALL"]}},"XLookupMethod":{"name":"X-Lookup-Method","in":"header","required":false,"description":"Lookup method, used only with Lookup Tables.","schema":{"type":"string","enum":["LOOKUP_EXISTS","LOOKUP_VALUE"]}},"XCorrelationId":{"name":"X-Correlation-Id","in":"header","required":false,"description":"Correlation ID, if you'd like to set it manually. If not present, it will be generated automatically and returned in the response.","schema":{"type":"string"}},"XDebug":{"name":"X-Debug","in":"header","required":false,"description":"On-premise deployments only: set to `true` to solve rules with the status pending. On DecisionRules Cloud this header has no effect.","schema":{"type":"string","enum":["true","false"]}},"XAudit":{"name":"X-Audit","in":"header","required":false,"description":"Whether to create and save an audit of the solve.","schema":{"type":"string","enum":["true","false"]}},"XAuditTtl":{"name":"X-Audit-Ttl","in":"header","required":false,"description":"Number of days after which the audit will be deleted. Default is 14 days.","schema":{"type":"string"}}},"requestBodies":{"SolveBody":{"required":true,"description":"Request body containing the input data and solver options.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"JSON object that describes the input json data."},"options":{"type":"object","description":"Object specifying solver options."}}}}}}},"responses":{"Solved":{"description":"OK","headers":{"X-Solver-Version":{"$ref":"#/components/headers/XSolverVersion"},"X-Solver-Engine":{"$ref":"#/components/headers/XSolverEngine"},"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationIdHeader"}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}},"BadRequestV1":{"description":"Bad Request. Returned for an unknown rule or a missing API key.","headers":{"X-Solver-Version":{"$ref":"#/components/headers/XSolverVersionV1"},"X-Solver-Engine":{"$ref":"#/components/headers/XSolverEngineV1"}},"content":{"application/json":{"schema":{"type":"object"}}}},"Unauthorized":{"description":"Authentication failed.","content":{"application/json":{"schema":{"type":"object"}}}}},"headers":{"XSolverVersion":{"description":"Solver version that evaluated the request, errors included.","schema":{"type":"string"}},"XSolverEngine":{"description":"Name of the solver engine that evaluated the request.","schema":{"type":"string"}},"XCorrelationIdHeader":{"description":"Correlation ID of the request.","schema":{"type":"string"}},"XSolverVersionV1":{"description":"Solver version that evaluated the request, errors included.","schema":{"type":"string"}},"XSolverEngineV1":{"description":"Name of the solver engine that evaluated the request.","schema":{"type":"string"}}}},"paths":{"/rule/solve/{ruleId}/{ruleVersion}":{"post":{"tags":["Rule Solver API v1"],"summary":"Solve Rule","description":"The original path without a solver version. It runs on solver v1. If the `{ruleVersion}` parameter is omitted from the path, the last published rule version will be used automatically.","parameters":[{"$ref":"#/components/parameters/ruleId"},{"$ref":"#/components/parameters/ruleVersion"},{"$ref":"#/components/parameters/ContentType"},{"$ref":"#/components/parameters/XStrategy"},{"$ref":"#/components/parameters/XLookupMethod"},{"$ref":"#/components/parameters/XCorrelationId"},{"$ref":"#/components/parameters/XDebug"},{"$ref":"#/components/parameters/XAudit"},{"$ref":"#/components/parameters/XAuditTtl"}],"requestBody":{"$ref":"#/components/requestBodies/SolveBody"},"responses":{"200":{"$ref":"#/components/responses/Solved"},"400":{"$ref":"#/components/responses/BadRequestV1"},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"solveRule"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decisionrules.io/doc/api/rule-solver-api/rule-solver-api-1.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
