Input
POST https://gateway.appypie.com/llamaguard-7b-awq/v1/llama-guard HTTP/1.1

Content-Type: application/json
Cache-Control: no-cache

{
    "userContent": "Discuss topics related to sexuality and sexual education."
}


import urllib.request, json

try:
    url = "https://gateway.appypie.com/llamaguard-7b-awq/v1/llama-guard"

    hdr ={
    # Request headers
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    }

    # Request body
    data =  
    data = json.dumps(data)
    req = urllib.request.Request(url, headers=hdr, data = bytes(data.encode("utf-8")))

    req.get_method = lambda: 'POST'
    response = urllib.request.urlopen(req)
    print(response.getcode())
    print(response.read())
    except Exception as e:
    print(e)

// Request body
const body = {
    "userContent": "Discuss topics related to sexuality and sexual education."
};

fetch('https://gateway.appypie.com/llamaguard-7b-awq/v1/llama-guard', {
        method: 'POST',
        body: JSON.stringify(body),
        // Request headers
        headers: {
            'Content-Type': 'application/json',
            'Cache-Control': 'no-cache',
            }
    })
    .then(response => {
        console.log(response.status);
        console.log(response.text());
    })
    .catch(err => console.error(err));
curl -v -X POST "https://gateway.appypie.com/llamaguard-7b-awq/v1/llama-guard" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H  --data-raw "{
    \"userContent\": \"Discuss topics related to sexuality and sexual education.\"
}"
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import java.io.UnsupportedEncodingException;
import java.io.DataInputStream;
import java.io.InputStream;
import java.io.FileInputStream;

public class HelloWorld {

  public static void main(String[] args) {
    try {
        String urlString = "https://gateway.appypie.com/llamaguard-7b-awq/v1/llama-guard";
        URL url = new URL(urlString);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();

        //Request headers
    connection.setRequestProperty("Content-Type", "application/json");
    
    connection.setRequestProperty("Cache-Control", "no-cache");
    
    
        connection.setRequestMethod("POST");

        // Request body
        connection.setDoOutput(true);
        connection
            .getOutputStream()
            .write(
             "{ \"userContent\": \"Discuss topics related to sexuality and sexual education.\" }".getBytes()
             );
    
        int status = connection.getResponseCode();
        System.out.println(status);

        BufferedReader in = new BufferedReader(
            new InputStreamReader(connection.getInputStream())
        );
        String inputLine;
        StringBuffer content = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            content.append(inputLine);
        }
        in.close();
        System.out.println(content);

        connection.disconnect();
    } catch (Exception ex) {
      System.out.print("exception:" + ex.getMessage());
    }
  }
}

$url = "https://gateway.appypie.com/llamaguard-7b-awq/v1/llama-guard";
$curl = curl_init($url);

curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

# Request headers
$headers = array(
    'Content-Type: application/json',
    'Cache-Control: no-cache',
    );
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

# Request body
$request_body = '{
    "userContent": "Discuss topics related to sexuality and sexual education."
}';
curl_setopt($curl, CURLOPT_POSTFIELDS, $request_body);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);

Output
LlamaGuard 7B  API

Llama Guard: Power with Unmatched Input-Output Security

meta

Llama Guard is revolutionizing the way businesses manage input-output security with its unmatched protection system. Designed to safeguard sensitive data, Llama Guard offers a comprehensive security solution that monitors and filters all data traffic, ensuring no unauthorized information leaves or enters your network. Its advanced threat detection technology is powered by AI, identifying potential vulnerabilities and stopping breaches in real-time. Whether it's for preventing data leaks, thwarting cyber-attacks, or maintaining regulatory compliance, Llama Guard stands as the ultimate guardian of your information.

With an easy-to-use interface and robust integration capabilities, Llama Guard fits seamlessly into existing IT infrastructures, providing continuous monitoring without disrupting operations. Its scalable nature ensures that as your organization grows, Llama Guard grows with you, adapting to increasing security needs. For developers, Llama Guard offers the powerful Llama Guard API, which allows for streamlined integration into custom applications, enhancing security layers across various platforms while maintaining superior performance. Protect your data, and protect your business with Llama Guard.

How to run Run Llama Guard with an API?

Running Llama Guard with the API is a simple and efficient way to ensure advanced input-output security for your applications. Here’s a step-by-step guide on how to integrate and run Llama Guard API:

generate_01

Get Your API Key

Start by signing up or logging into the platform that provides access to the Llama Guard API. Once you’re signed in, you’ll receive an API key. This key is critical for authenticating API requests and ensuring secure communication.

generate_02

Set Up Development Environment and Prompt

To set up your development environment and prompt for the Llama Guard API, start by choosing your preferred programming language, such as Python, JavaScript, or PHP. Once your environment is ready, prepare a detailed prompt by specifying the input data and any security parameters, such as security level and output format, to be included in the API request.

generate_03

Send the API Request

After setting up your environment and preparing the prompt, it's time to send the API request. Construct an HTTP POST request to the Llama Guard API endpoint. Ensure you include the API key in the request headers for authentication and pass the input data and security parameters in the request body.

generate_04

Handle the API Response

Once the API request is successfully processed, the Llama Guard API will return a response that may include the filtered data, threat analysis, or security alerts based on the input. You'll receive the output in the format you specified.

Use Cases of Llama Guard API

The Llama Guard API offers powerful security features that protect businesses from data breaches, cyber threats, and unauthorized access. Below are key use cases demonstrating how the API enhances data security, ensures compliance, and safeguards sensitive information in real time.

cases_1

Real-Time Threat Detection

The Llama Guard API provides real-time monitoring of data traffic, detecting suspicious activities and potential threats as they happen. This ensures that businesses can respond immediately to security breaches, preventing data loss and protecting critical systems from cyberattacks in high-risk environments.

cases_2

Data Leak Prevention

Llama Guard API helps safeguard sensitive data by monitoring and filtering outgoing traffic. It prevents unauthorized data from being transmitted outside the network, offering an essential layer of protection for companies dealing with confidential information, such as financial records, customer data, or intellectual property.

cases_3

Secure Application Development

Developers can use the Llama Guard API to integrate advanced security features into their applications, ensuring that data input and output remain secure. This is especially important for industries like healthcare, finance, and e-commerce, where protecting user information is critical to compliance and trust.

cases_4

Compliance with Data Protection Regulations

For organizations bound by strict data protection regulations, such as GDPR or HIPAA, Llama Guard API ensures that data is securely handled and transmitted. It automatically monitors and controls access to sensitive data, helping businesses maintain compliance with industry-specific standards and avoid costly penalties.

cases_5

Customizable Security Solutions

The Llama Guard API allows businesses to set custom security parameters based on their unique needs, such as adjusting threat levels or selecting preferred output formats. This flexibility makes it ideal for organizations of all sizes, providing tailored security that adapts as business needs evolve.

cases_6

Automated Security Monitoring

Using the Llama Guard API, companies can automate their security monitoring processes, eliminating the need for constant manual intervention. This ensures continuous protection of networks and applications without compromising performance, providing a seamless and efficient security solution for real-time data flow.

Top Trending Generative AI APIs

 

Maximize the potential of your projects with our Generative AI APIs. From video generation & image creation to text generation, animation, 3D modeling, prompt generation, image restoration, and code generation, our advanced APIs cover all aspects of generative AI to meet your needs.