Aura API Gateway - OpenAPI Specification

📋 Overview

This document provides the OpenAPI specification for the Aura Platform API Gateway. The gateway provides RESTful endpoints for AI agents to interact with the negotiation and search services.

🔐 Security

All endpoints require the following security headers:

Required Headers

Header
Type
Description
Example

X-Agent-ID

string

Agent's Decentralized Identifier (DID)

did:key:public_key_hex

X-Timestamp

string

Unix timestamp (seconds)

1735689600

X-Signature

string

Hex-encoded Ed25519 signature

a1b2c3d4...

Signature Verification

The platform uses Ed25519 (via PyNaCl) for cryptographic verification. The signature is verified against the following message:

message = method + path + timestamp + body_hash

Where:

  • method: HTTP method in uppercase (e.g., POST)

  • path: Request path (e.g., /v1/negotiate)

  • timestamp: The exact string from the X-Timestamp header

  • body_hash: SHA-256 hash of the canonical JSON body (sorted keys, no whitespace)

📡 Endpoints

Base URL

1. Negotiate Endpoint

POST /v1/negotiate

Description

Initiates a negotiation session for a specific item. The agent submits a bid, and the system responds with acceptance, counteroffer, rejection, or a request for human intervention.

Request

Headers:

Body:

Schema:

Responses

200 OK - Successful Negotiation

Response Types:

  1. Accepted Response (status: "accepted")

Aura supports both immediate reservation and Locked Deals requiring crypto payment.

Immediate Reveal:

Locked Deal (Solana):

  1. Countered Response (status: "countered")

  1. Rejected Response (status: "rejected")

  1. UI Required Response (status: "ui_required")

Response Schema:

Error Responses:

400 Bad Request

401 Unauthorized

429 Too Many Requests

500 Internal Server Error

2. Search Endpoint

POST /v1/search

Description

Performs semantic search across the inventory using vector embeddings. Returns items ranked by similarity to the query.

Request

Headers:

Body:

Schema:

Responses

200 OK - Successful Search

Response Schema:

Error Responses:

400 Bad Request

500 Internal Server Error

3. Check Deal Status

POST /v1/deal/status (Internal gRPC: CheckDealStatus)

Description

Checks if a locked deal has been paid on-chain. If paid, reveals the secret reservation code.

Request

Headers:

Body:

Response

200 OK - Paid

200 OK - Pending

📊 Response Status Types

Accepted (status: "accepted")

Description: The bid has been accepted. The agent can proceed with the transaction using the provided reservation code.

Use Case: Bid meets or exceeds the floor price and business rules.

Example Scenario: Agent bids $850 for an item with $800 floor price.

Countered (status: "countered")

Description: The bid is too low, but the system is willing to negotiate. A counteroffer is proposed.

Use Case: Bid is below floor price but within a negotiable range.

Example Scenario: Agent bids $700 for an item with $800 floor price, system counters with $800.

Reason Codes:

  • BELOW_FLOOR: Bid is below the minimum acceptable price

  • NEGOTIATION_ONGOING: Part of an ongoing negotiation sequence

  • MARKET_CONDITIONS: Current market conditions warrant a higher price

Rejected (status: "rejected")

Description: The bid is unacceptable and no counteroffer is made.

Use Case: Bid is unreasonably low or item doesn't exist.

Example Scenario: Agent bids $1 for a premium item.

Reason Codes:

  • OFFER_TOO_LOW: Bid is unreasonably low

  • ITEM_NOT_FOUND: Requested item doesn't exist

  • AI_ERROR: LLM decision making failed

UI Required (status: "ui_required")

Description: Human intervention is required before proceeding. The agent must present this to a human for approval.

Use Case: High-value transactions, suspicious activity, or policy requirements.

Example Scenario: Agent bids $1200 for an item, triggering security review.

Template Types:

  • high_value_confirm: Confirmation required for high-value transaction

  • suspicious_activity: Potential fraud detection

  • policy_violation: Violation of business policies

🎯 Usage Examples

Example 1: Successful Negotiation

Request:

Response:

Example 2: Counteroffer

Request:

Response:

Request:

Response:

🔧 API Versioning

The API uses URL-based versioning:

Future versions will be added as:

📊 Rate Limiting

  • Default Limit: 100 requests per minute per agent

  • Response Headers:

    • X-RateLimit-Limit: Maximum allowed requests

    • X-RateLimit-Remaining: Remaining requests in current window

    • X-RateLimit-Reset: Time when limit resets (Unix timestamp)

📚 OpenAPI Specification

A machine-readable OpenAPI specification is available. This document serves as the human-readable version with additional context and examples.

🤝 Support

For API-related issues or questions, please refer to the main README or open an issue in the GitHub repository.

Последнее обновление