> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneshotagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Compound Resolve

> Resolve a name, CAS number, InChIKey or SMILES to chemical compound identities.

Give exactly one of name (a common, trade or systematic name, or a CAS registry number), inchikey or smiles. Returns compound identifiers, computed names, molecular formulas, InChIKeys, connectivity SMILES and compound page links. Matches retain the source order, up to limit. Ambiguous is true whenever the source matched more than one CID, even if limit returns only one. An unknown compound returns an empty matches list. SMILES containing / or \ are refused because the source path form cannot carry them. Identity only: no synonym lists, depositor records, synthesis routes, preparation methods or precursor lists.

## Authentication

Requires x402 payment in the `payment-signature` header.

## Request Body

<ParamField body="name" type="string">
  A common, trade or systematic chemical name, or a CAS registry number such as 50-78-2; give exactly one of name, inchikey or smiles. 2 to 200 characters.
</ParamField>

<ParamField body="inchikey" type="string">
  The compound InChIKey; give exactly one of name, inchikey or smiles. Exactly 27 characters.
</ParamField>

<ParamField body="smiles" type="string">
  A SMILES structure string without / or , which the source path form cannot carry; give exactly one of name, inchikey or smiles. 1 to 500 characters.
</ParamField>

<ParamField body="limit" type="integer">
  The most matching compounds to return. From 1 to 10. Defaults to `5`.
</ParamField>

<Snippet file="audit-context-params.mdx" />

## Response (200 OK)

Top-level envelope: `success` (boolean) and `data` (object). All fields below are nested under `data`.

<ResponseField name="data.request_id" type="string">
  Durable job ID for audit and lookup
</ResponseField>

<ResponseField name="data.status" type="string">
  Job status: `completed`
</ResponseField>

<ResponseField name="data.tool" type="string">
  Always `compound_resolve`
</ResponseField>

<ResponseField name="data.result" type="object">
  The answer, described under Result below
</ResponseField>

<ResponseField name="data.evidence" type="object">
  Where the answer came from and when
</ResponseField>

<ResponseField name="data.evidence.source" type="string">
  The public body the data comes from. Always `US National Center for Biotechnology Information (PubChem)`.
</ResponseField>

<ResponseField name="data.evidence.source_kind" type="string">
  `public` when the data comes from a public body, `commercial` otherwise
</ResponseField>

<ResponseField name="data.evidence.retrieved_at" type="string">
  When the lookup was made, as an ISO 8601 UTC time
</ResponseField>

<ResponseField name="data.evidence.as_of" type="string">
  When the source says the fact was last updated, or `null` when the source gives no date
</ResponseField>

## Result

Nested under `data.result`.

<ResponseField name="data.result.matches" type="object[]">
  Matching compounds in source order, up to limit.
</ResponseField>

<ResponseField name="data.result.matches[].cid" type="integer">
  The PubChem compound identifier.
</ResponseField>

<ResponseField name="data.result.matches[].iupac_name" type="string">
  The computed systematic name.
</ResponseField>

<ResponseField name="data.result.matches[].molecular_formula" type="string">
  The molecular formula.
</ResponseField>

<ResponseField name="data.result.matches[].inchikey" type="string">
  The InChIKey identifier.
</ResponseField>

<ResponseField name="data.result.matches[].smiles" type="string">
  The connectivity SMILES structure string.
</ResponseField>

<ResponseField name="data.result.matches[].page_url" type="string">
  The compound page URL.
</ResponseField>

<ResponseField name="data.result.ambiguous" type="boolean">
  True when the source returned more than one CID, before applying limit.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://win.oneshotagent.com/v1/tools/resolve/compound \
    -H "Content-Type: application/json" \
    -H "payment-signature: <base64 x402 payment>" \
    -d '{
      "name": "aspirin"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://win.oneshotagent.com/v1/tools/resolve/compound", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "payment-signature": paymentProof,
    },
    body: JSON.stringify({
      "name": "aspirin"
    }),
  });
  ```

  ```typescript SDK theme={null}
  const result = await agent.tool('resolve/compound', {
    name: 'aspirin'
  });
  console.log(result.data.result);
  console.log(result.data.evidence);
  ```
</RequestExample>

<ResponseExample>
  ```json Response (200) theme={null}
  {
    "success": true,
    "data": {
      "request_id": "uuid",
      "receipt_id": "rcpt_...",
      "status": "completed",
      "tool": "compound_resolve",
      "result": {
        "matches": [
          {
            "cid": 2244,
            "iupac_name": "2-acetyloxybenzoic acid",
            "molecular_formula": "C9H8O4",
            "inchikey": "BSYNRYMUTXBXSQ-UHFFFAOYSA-N",
            "smiles": "CC(=O)OC1=CC=CC=C1C(=O)O",
            "page_url": "https://pubchem.ncbi.nlm.nih.gov/compound/2244"
          }
        ],
        "ambiguous": false
      },
      "evidence": {
        "source": "US National Center for Biotechnology Information (PubChem)",
        "source_kind": "public",
        "retrieved_at": "2026-01-15T12:00:00.000Z",
        "calls": [
          {
            "retrieved_at": "2026-01-15T12:00:00.000Z"
          }
        ],
        "as_of": null
      }
    }
  }
  ```
</ResponseExample>

<Info>See [Pricing](/pricing) for this tool's price. A wallet (x402) call receives it in the 402 quote before anything is charged; a call paid from prepaid credits is charged when the API accepts the request and answers `200`.</Info>

## Notes

* Results return inline. The finished job stays available at `/v1/requests/{request_id}`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.