{
  "openapi": "3.1.0",
  "info": {
    "title": "AUN DOI metadata",
    "version": "0.1.0",
    "description": "Free research preview. Crossref bibliographic metadata only; no scientific validity or complete retraction checking."
  },
  "paths": {
    "/api/doi": {
      "get": {
        "operationId": "lookupDoi",
        "summary": "Retrieve Crossref metadata for a known DOI",
        "parameters": [
          {
            "name": "doi",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 250
            },
            "example": "10.1038/nphys1170"
          }
        ],
        "responses": {
          "200": {
            "description": "Bibliographic metadata including provenance and limitations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "doi",
                    "title",
                    "authors",
                    "provenance",
                    "limitations"
                  ],
                  "properties": {
                    "doi": {
                      "type": "string"
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "authors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "given": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "family": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "orcid": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "authors_truncated": {
                      "type": "boolean"
                    },
                    "container_title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publisher": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "published_date_parts": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "integer"
                      }
                    },
                    "citation_count": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "reported_updates": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "provenance": {
                      "type": "object",
                      "required": [
                        "provider",
                        "source_url",
                        "retrieved_at",
                        "source_sha256"
                      ],
                      "properties": {
                        "provider": {
                          "type": "string",
                          "const": "Crossref"
                        },
                        "source_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "retrieved_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "source_sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        }
                      }
                    },
                    "limitations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "DOI not found in Crossref",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid DOI",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Provider error or timeout",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Provider rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Backend concurrency limit; retry later",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://agentutility.network"
    }
  ]
}
