# Ozmium Agent API – Morpho Midnight Fixed-Rate Collateral Withdrawal

> Ozmium Agent API – Morpho Midnight Fixed-Rate Collateral Withdrawal is a paid API for AI agents from ozmium.org, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Generates calldata for withdrawing collateral from a Morpho Midnight fixed-rate market on Base, returning signed transaction steps ready for agent execution.

## Facts

- Endpoint: POST https://ozmium.org/v1/tx/fixed/withdraw-collateral
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ozmium-agent-api-morpho-midnight-fixed-rate-collateral-withdrawal-ed0a8780
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cqWKgx4kP407Xqgmltu0k

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability ozmium-agent-api-morpho-midnight-fixed-rate-collateral-withdrawal-ed0a8780 -d '<json body>'
```

Example prompt: Generate the calldata to withdraw 5000 USDC worth of collateral (in atomic units) from my Morpho Midnight fixed-rate market with marketId 0xabc123 using my wallet address 0xYourOwnerAddress on Base.

## When to prefer this

Use this endpoint when an AI agent needs to generate ready-to-execute calldata for withdrawing collateral from a Morpho Midnight fixed-rate market on Base, specifically within the Ozmium ecosystem. Prefer this over generic DeFi SDKs when you need a simple API call that returns structured transaction steps without requiring the agent to construct ABI-encoded calls manually. Pair it with the supply-collateral and borrow endpoints for full position lifecycle management.

## Known failure modes

- Invalid or unknown marketId returns an error indicating market not found
- Assets value of zero or exceeding deposited collateral returns a validation error
- Owner address not matching a collateral position may return empty or rejected calldata
- Malformed request body (missing required fields) returns a 400 bad request
- Payment failure or missing x402 payment header returns a 402 payment required
- Network downtime on Base may cause calldata generation to fail with a 5xx error

## How this service works

Morpho Midnight collateral withdrawal calldata. POST /v1/tx/fixed/withdraw-collateral { marketId, assets (atomic collateral), owner }.

## Output

An array of transaction steps (to, data, value) along with the target network identifier, encoding the withdrawCollateral call against the Morpho Midnight market contract on Base. The agent can pass these steps directly to a wallet or broadcast layer for execution.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "steps": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "to": {
          "type": "string"
         },
         "data": {
          "type": "string"
         },
         "value": {
          "type": "string"
         }
        }
       }
      },
      "network": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ozmium-agent-api-morpho-midnight-fixed-rate-collateral-withdrawal-ed0a8780/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ozmium.org](https://www.zero.xyz/host/ozmium.org/llms.txt)
