{"openapi":"3.1.0","info":{"title":"Anara Platform API","version":"1.0.0","description":"Developer APIs for search and identifier resolution. Authenticate with a workspace API key as a bearer token or X-API-Key header."},"paths":{"/v1/health":{"get":{"tags":["health"],"operationId":"health","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"service":{"type":"string"}},"required":["ok","service"],"additionalProperties":false}}}}}}},"/v1/resolve":{"post":{"tags":["papers"],"operationId":"papers.lookup","parameters":[],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"papers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"year":{"anyOf":[{"type":"number"},{"type":"null"}]},"doi":{"type":"string"},"venue":{"type":"string"},"publicationDate":{"type":"string"},"field":{"type":"string"},"language":{"type":"string"},"arxivId":{"type":"string"},"pmcid":{"type":"string"},"pmid":{"type":"string"},"citedByCount":{"type":"number"},"abstract":{"type":"string"},"pdfUrl":{"type":"string"},"landingPageUrl":{"type":"string"},"openAccess":{"type":"boolean"},"hasFulltext":{"type":"boolean"},"type":{"type":"string"},"snippets":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"citeId":{"type":"string"},"page":{"type":"number"}},"required":["text","citeId"],"additionalProperties":false}}},"required":["id","title","authors","year","citedByCount","openAccess","hasFulltext"],"additionalProperties":false}},"resolutions":{"type":"array","items":{"type":"object","properties":{"input":{"type":"string"},"status":{"type":"string","enum":["resolved","ambiguous","unresolved"]},"paperIds":{"type":"array","items":{"type":"string"}}},"required":["input","status","paperIds"],"additionalProperties":false}},"charge":{"type":"object","properties":{"costMicroUsd":{"type":"number"},"balanceMicroUsd":{"type":"number"}},"required":["costMicroUsd","balanceMicroUsd"],"additionalProperties":false}},"required":["papers","resolutions","charge"],"additionalProperties":false}}}},"400":{"description":"InvalidRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequestEncoded"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"402":{"description":"PaymentRequired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredEncoded"}}}},"403":{"description":"InsufficientScope | HipaaRestricted","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeEncoded"},{"$ref":"#/components/schemas/HipaaRestrictedEncoded"}]}}}},"429":{"description":"RateLimited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedEncoded"}}}},"502":{"description":"UpstreamUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamUnavailableEncoded"}}}}},"description":"Resolve DOIs, arXiv, OpenAlex, PubMed ids or exact titles to papers. Free up to the fair-use cap, then $0.10 per 1k.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"identifiers":{"type":"array","items":{"type":"string","minLength":1,"maxLength":512},"maxItems":100},"titles":{"type":"array","items":{"type":"string","minLength":1,"maxLength":512},"maxItems":50},"maxResults":{"type":"integer","minimum":1,"maximum":100}},"additionalProperties":false}}},"required":true}}},"/v1/search":{"post":{"tags":["papers"],"operationId":"papers.search","parameters":[],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"papers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"year":{"anyOf":[{"type":"number"},{"type":"null"}]},"doi":{"type":"string"},"venue":{"type":"string"},"publicationDate":{"type":"string"},"field":{"type":"string"},"language":{"type":"string"},"arxivId":{"type":"string"},"pmcid":{"type":"string"},"pmid":{"type":"string"},"citedByCount":{"type":"number"},"abstract":{"type":"string"},"pdfUrl":{"type":"string"},"landingPageUrl":{"type":"string"},"openAccess":{"type":"boolean"},"hasFulltext":{"type":"boolean"},"type":{"type":"string"},"snippets":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"citeId":{"type":"string"},"page":{"type":"number"}},"required":["text","citeId"],"additionalProperties":false}}},"required":["id","title","authors","year","citedByCount","openAccess","hasFulltext"],"additionalProperties":false}},"totalApprox":{"type":"number"},"totalEstimate":{"type":"number"},"charge":{"type":"object","properties":{"costMicroUsd":{"type":"number"},"balanceMicroUsd":{"type":"number"}},"required":["costMicroUsd","balanceMicroUsd"],"additionalProperties":false}},"required":["papers","totalApprox","charge"],"additionalProperties":false}}}},"400":{"description":"InvalidRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequestEncoded"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"402":{"description":"PaymentRequired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredEncoded"}}}},"403":{"description":"InsufficientScope | HipaaRestricted","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeEncoded"},{"$ref":"#/components/schemas/HipaaRestrictedEncoded"}]}}}},"429":{"description":"RateLimited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedEncoded"}}}},"502":{"description":"UpstreamUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamUnavailableEncoded"}}}}},"description":"Search by type: instant ($2 per 1k), standard ($5 per 1k), or deep full-text search with citable passages ($12 per 1k). Defaults to standard.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000},"maxResults":{"type":"integer","minimum":1,"maximum":100},"filters":{"type":"object","properties":{"publicationYear":{"type":"string","maxLength":200},"isOpenAccess":{"type":"boolean"},"hasFulltext":{"type":"boolean"},"authorName":{"type":"string","maxLength":200},"sourceName":{"type":"string","maxLength":200},"field":{"type":"string","maxLength":200},"citedByCount":{"type":"string","maxLength":200}},"additionalProperties":false},"includeTotal":{"type":"boolean"},"type":{"type":"string","enum":["instant","standard","deep"]},"sort":{"type":"string","enum":["relevance","recent","citations"]}},"required":["query"],"additionalProperties":false}}},"required":true}}},"/v1/search/total":{"post":{"tags":["papers"],"operationId":"papers.total","parameters":[],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"totalEstimate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["totalEstimate"],"additionalProperties":false}}}},"400":{"description":"InvalidRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequestEncoded"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"403":{"description":"InsufficientScope | HipaaRestricted","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeEncoded"},{"$ref":"#/components/schemas/HipaaRestrictedEncoded"}]}}}},"429":{"description":"RateLimited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedEncoded"}}}},"502":{"description":"UpstreamUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamUnavailableEncoded"}}}}},"description":"Estimate how many papers match a search. Call it alongside /v1/search with the same query and filters; it answers in a few seconds without delaying results. Free.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000},"filters":{"type":"object","properties":{"publicationYear":{"type":"string","maxLength":200},"isOpenAccess":{"type":"boolean"},"hasFulltext":{"type":"boolean"},"authorName":{"type":"string","maxLength":200},"sourceName":{"type":"string","maxLength":200},"field":{"type":"string","maxLength":200},"citedByCount":{"type":"string","maxLength":200}},"additionalProperties":false},"type":{"type":"string","enum":["instant","standard"]}},"required":["query"],"additionalProperties":false}}},"required":true}}},"/v1/keys/current":{"get":{"tags":["keys"],"operationId":"keys.current","parameters":[],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyPrefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["pdf","papers"]}},"workspaceId":{"type":"string"},"createdAt":{"type":"string"},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","keyPrefix","scopes","workspaceId","createdAt","revokedAt"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"429":{"description":"RateLimited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedEncoded"}}}},"502":{"description":"UpstreamUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamUnavailableEncoded"}}}}},"description":"Describe the key used for this request."}},"/v1/keys/current/revoke":{"post":{"tags":["keys"],"operationId":"keys.revokeCurrent","parameters":[],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyPrefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["pdf","papers"]}},"workspaceId":{"type":"string"},"createdAt":{"type":"string"},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","keyPrefix","scopes","workspaceId","createdAt","revokedAt"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"429":{"description":"RateLimited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedEncoded"}}}},"502":{"description":"UpstreamUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamUnavailableEncoded"}}}}},"description":"Revoke the key used for this request. Every later request with it answers 401."}},"/v1/account/balance":{"get":{"tags":["account"],"operationId":"account.balance","parameters":[],"security":[{"bearer":[]},{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"balanceMicroUsd":{"type":"number"},"balanceUsd":{"type":"number"},"grantMonth":{"anyOf":[{"type":"string"},{"type":"null"}]},"lots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"remainingMicroUsd":{"type":"number"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","remainingMicroUsd","expiresAt"],"additionalProperties":false}},"rateCard":{"type":"object","properties":{"lookupPer1kUsd":{"type":"number"},"lookupFreePerMonth":{"type":"number"},"instantPer1kUsd":{"type":"number"},"searchPer1kUsd":{"type":"number"},"deepPer1kUsd":{"type":"number"},"monthlyGrantUsd":{"type":"number"}},"required":["lookupPer1kUsd","lookupFreePerMonth","instantPer1kUsd","searchPer1kUsd","deepPer1kUsd","monthlyGrantUsd"],"additionalProperties":false}},"required":["balanceMicroUsd","balanceUsd","grantMonth","lots","rateCard"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedEncoded"}}}},"429":{"description":"RateLimited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedEncoded"}}}},"502":{"description":"UpstreamUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpstreamUnavailableEncoded"}}}}},"description":"Prepaid balance, credit lots and the current rate card for the key’s workspace."}}},"components":{"schemas":{"UnauthorizedEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["Unauthorized"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false},"InsufficientScopeEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["InsufficientScope"]},"message":{"type":"string"},"required":{"type":"string","enum":["pdf","papers"]}},"required":["_tag","message","required"],"additionalProperties":false},"HipaaRestrictedEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["HipaaRestricted"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false},"PaymentRequiredEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["PaymentRequired"]},"message":{"type":"string"},"balanceMicroUsd":{"type":"number"},"requiredMicroUsd":{"type":"number"},"topUpUrl":{"type":"string"}},"required":["_tag","message","balanceMicroUsd","requiredMicroUsd","topUpUrl"],"additionalProperties":false},"InvalidRequestEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["InvalidRequest"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false},"UpstreamUnavailableEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["UpstreamUnavailable"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false},"RateLimitedEncoded":{"type":"object","properties":{"_tag":{"type":"string","enum":["RateLimited"]},"message":{"type":"string"}},"required":["_tag","message"],"additionalProperties":false}},"securitySchemes":{"bearer":{"type":"http","scheme":"Bearer"},"apiKey":{"type":"apiKey","name":"X-API-Key","in":"header"}}},"security":[],"tags":[{"name":"health"},{"name":"papers"},{"name":"keys"},{"name":"account"}]}