Hey there

Go to your dashboard & get your API key to get started with Naive AI's peaceful language processing API.

Using Your API Key

Add a header named X-API-Key with the value of your API key in your requests.

cURL
JS
Go

/api/analyze

returns an array of non-naive expressions with reasons
curl -X POST 'https://naively.me/api/analyze' \
        -H 'X-API-Key: your-api-key-here' \
        -H 'Content-Type: application/json' \
        -d '{"expression": "Just try not to drag everyone else down."}'
[
            {
                "word": "drag everyone else down",
                "reason": "This phrase implies the act of causing harm or detriment to others, which is considered non-peaceful"
            }
        ]

/api/check

returns true for naive expressions
curl -X POST 'https://naively.me/api/check' \
        -H 'X-API-Key: your-api-key-here' \
        -H 'Content-Type: application/json' \
        -d '{"expression": "Just try not to drag everyone else down."}'
false

/api/analyze

returns an array of non-naive expressions with reasons
let expression = 'Just try not to drag everyone else down.'
        fetch('https://naively.me/api/analyze', {
            method: 'POST',
            body: JSON.stringify({ expression }),
            headers: {
                'X-API-Key': 'your-api-key-here',
                'Content-Type': 'application/json'
            }
        })
        .then(response => response.json())
        .then(data => console.log(data))
        .catch(error => console.error('Error:', error));
[
            {
                "word": "drag everyone else down",
                "reason": "This phrase implies the act of causing harm or detriment to others, which is considered non-peaceful"
            }
        ]


/api/check

returns true for naive expressions
let expression = 'Just try not to drag everyone else down.'
        fetch('https://naively.me/api/check', {
            method: 'POST',
            body: JSON.stringify({ expression }),
            headers: {
                'X-API-Key': 'your-api-key-here',
                'Content-Type': 'application/json'
            }
        })
        .then(response => response.json())
        .then(data => console.log(data))
        .catch(error => console.error('Error:', error));
false

/api/analyze

returns an array of non-naive expressions with reasons
package main
        
        import (
            "bytes"
            "encoding/json"
            "fmt"
            "io"
            "net/http"
        )
        
        func main() {
          client := &http.Client{}
          payload := map[string]string{"expression": "Just try not to drag everyone else down."}
          jsonPayload, err := json.Marshal(payload)
          if err != nil {
              fmt.Println("Error marshaling payload:", err)
              return
          }
      
          req, err := http.NewRequest("POST", "https://naively.me/api/analyze", bytes.NewBuffer(jsonPayload))
          if err != nil {
              fmt.Println("Error creating request:", err)
              return
          }
      
          req.Header.Add("X-API-Key", "your-api-key-here")
          req.Header.Add("Content-Type", "application/json")
      
          resp, err := client.Do(req)
          if err != nil {
              fmt.Println("Error making request:", err)
              return
          }
          defer resp.Body.Close()
      
          body, err := io.ReadAll(resp.Body)
          if err != nil {
              fmt.Println("Error reading response body:", err)
              return
          }
          fmt.Println(string(body))
      }
        
[
            {
                "word": "drag everyone else down",
                "reason": "This phrase implies the act of causing harm or detriment to others, which is considered non-peaceful"
            }
        ]

/api/check

returns true for naive expressions
package main
        
        import (
            "bytes"
            "encoding/json"
            "fmt"
            "io"
            "net/http"
        )
        
        func main() {
          client := &http.Client{}
          payload := map[string]string{"expression": "Just try not to drag everyone else down."}
          jsonPayload, err := json.Marshal(payload)
          if err != nil {
              fmt.Println("Error marshaling payload:", err)
              return
          }
      
          req, err := http.NewRequest("POST", "https://naively.me/api/check", bytes.NewBuffer(jsonPayload))
          if err != nil {
              fmt.Println("Error creating request:", err)
              return
          }
          req.Header.Add("X-API-Key", "your-api-key-here")
          req.Header.Add("Content-Type", "application/json")
      
          resp, err := client.Do(req)
          if err != nil {
              fmt.Println("Error making request:", err)
              return
          }
          defer resp.Body.Close()
      
          body, err := io.ReadAll(resp.Body)
          if err != nil {
              fmt.Println("Error reading response body:", err)
              return
          }
          fmt.Println(string(body))
      }
false