# API Integration

### Tokens that support permit

1. Get a quote from odos
2. POST <https://api.smolrefuel.com/quote> with body {"chainId":1,"priceRoute":{... quote from odos ...}, "srcDecimals":18,"params":{"token":"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72","from":"USER\_ADDRESS","amount":"1000000000000000000"}}
3. POST <https://api.smolrefuel.com/refuel> with body {"chainId":1,"priceRoute":{... quote from odos ...}, "srcDecimals":18,"params":{"token":"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72","from":"USER\_ADDRESS","amount":"1000000000000000000", deadline:string, v:number, r:string, s:string}, partner: "your name", tokenPrices:{...}}
4. Trade will be sent and you'll get back a tx hash

### Tokens that don't support permit

1. POST <https://api.smolrefuel.com/loan-quote> with body {"chainId":1,"token":"0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5","from":"USER\_ADDRESS","amount":"100000000"}
2. Have user sign the message

   ```typescript
   I commit to completing the swap on smolrefuel.com after receiving my loan
   ```
3. Send that signature to POST <https://api.smolrefuel.com/get-loan>, with body

   ```typescript
   {
           chainId,
           token,
           from,
           amount,
           signature,
           partner
    }
   ```
4. Have user send an approve() transaction on the token approving our contract
5. POST <https://api.smolrefuel.com/execute-swap> with body

   ```typescript
   {
           chainId,
           token,
           from,
           partner
   }
   ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.smolrefuel.com/integrate/api-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
