Clay Icon

How to Access Your Private Custom GPT in Clay

·
·

Hi team -- I'd like to access a private custom GPT inside of clay. I've connected my openAI account via API key and the connection is successful, but how do I find my GPT?

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·

    We don't currently offer access to private custom GPTs within Clay. Our AI integration is powered by GPT, Claude, or Gemini models, which you can access using either our Clay-managed account or your own API key.To use your own OpenAI API key in Clay: 1. Go to your profile settings or the enrichment panel. 2. Select "Add Account" under the Model > Account section. 3. Follow the prompts to input your OpenAI API key.This allows you to use OpenAI's standard models in Clay workflows, but doesn't include access to private custom GPTs.Is there a specific task or functionality you're looking to achieve with a custom GPT in Clay? Sources: Use AI integration overview | Documentation | Clay University Guide: Ways to save Clay credits | Documentation | Clay University ChatGPT: Generate text with OpenAI/GPT | Clay.com

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·

    Looks like you're still looking for help. If you’re dealing with a specific table, drop the URL below so we can help you quicker. Otherwise, someone from our team will be in touch soon!

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    I was thinking custom GPT access was available at one point. Am I imagining that, or did this change?

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Or maybe, is there an HTTP API action I can use to tie into my custom GPT? 🙂

  • Avatar of Owen C.
    Owen C.
    ·
    ·

    Hey Andrew, thanks for reaching out! Given Custom GPT's don't have an API key associated with them this is not possible directly. However, there've attempts to connect an Assistant from OpenAI however which could likely be done through HTTP API. If you're interested in trying to set that up let me know and we can figure out what that looks like. :)

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Hi Owen! Can you give me more info on the Assistant option? I might be interested in that.

  • Avatar of Owen C.
    Owen C.
    ·
    ·

    Absolutely - Typically that would require a multistep enrichment. I know it's quite complicated so feel totally fine to let us know if you run into any issues. Here's how: 1. Create Assistant Call: Endpoint: https://api.openai.com/v1/assistants Method: POST Headers: - Authorization: Bearer YOUR_API_KEY - OpenAI-Beta: assistants=v1 Body: { "model": "gpt-4-turbo-preview", "name": "Math Tutor", "instructions": "You are a personal math tutor. Write in a friendly tone.", "tools": [{"type": "code_interpreter"}] } 2. Create Thread: Endpoint: https://api.openai.com/v1/threads Method: POST Headers: - Authorization: Bearer YOUR_API_KEY - OpenAI-Beta: assistants=v1 Body: {} 3. Add Message to Thread: Endpoint: https://api.openai.com/v1/threads/{thread_id}/messages Method: POST Headers: - Authorization: Bearer YOUR_API_KEY - OpenAI-Beta: assistants=v1 Body: { "role": "user", "content": "Your message here" } Make sure to replace thread_id with the previous value 4. Run Assistant: Endpoint: https://api.openai.com/v1/threads/{thread_id}/runs Method: POST Headers: - Authorization: Bearer YOUR_API_KEY - OpenAI-Beta: assistants=v1 Body: { "assistant_id": "asst_xxx", "instructions": "Please address the user's message" } Make sure to replace thread_id with the previous value. This will return the run Id 5. Check Run Status: Endpoint: https://api.openai.com/v1/threads/{thread_id}/runs/{run_id} Method: GET Headers: - Authorization: Bearer YOUR_API_KEY - OpenAI-Beta: assistants=v1 Make sure to replace thread_id and run_id with the previous value 6. Get Messages (after completion): Endpoint: https://api.openai.com/v1/threads/{thread_id}/messages Method: GET Headers: - Authorization: Bearer YOUR_API_KEY - OpenAI-Beta: assistants=v1 Make sure to replace thread_id with the previous value Reminder to replace placeholders: - YOUR_API_KEY: Your OpenAI API key - thread_id: ID received from Create Thread response - run_id: ID received from Run Assistant response - asst_xxx: Assistant ID from Create Assistant response Make these calls in sequence to get a response from an OpenAI Assistant.

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Super interesting. Once you've created the assistant, can you reference it again in the future, or do you have to do that for each row in a sheet?

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Hmmm... Thinking through this, I may try pairing this with Zapier. I think that will allow me to use a custom GPT...

  • Avatar of Owen C.
    Owen C.
    ·
    ·

    For the first message, essentially yes you should be able to reference the assistant again in the future. Absolutely, feel free to check out Zapier as any HTTP API column could trigger a custom workflow. Let me know how I can best assist here. :)

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Thanks.

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Yeah, I did some more digging, and I can't call a custom GPT in a zap. I'm trying to figure out how to use a custom GPT at scale. Open AI isn't making it easy. 🙂

  • Avatar of Owen C.
    Owen C.
    ·
    ·

    Of course, trust me I hear you with that. Curious, how much context or knowledge have you given the custom GPT? Are you trying to perform classification or segmentation or what is the use case exactly?

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    I'm trying to do highly technical research as the first step, but ultimately, I wanted to incorporate custom GPT actions. I might be able to use the instruction set with my custom GPT with the standard openAI integration and then use Clay for my custom actions, though. What I really wanted to do was use the custom actions to include a dynamic knowledge base based on a separate API access... The challenge with assistants is that I need access to web browsing, and they don't include that.

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    It's strange. I'm getting really good results from my custom GPT, but using the same instructions in a general prompt isn't working as well.

  • Avatar of Owen C.
    Owen C.
    ·
    ·

    Interesting. The general prompt excludes the dynamic knowledge you're referencing though correct? There may be a workaround with using N8N and sending a webhook that triggers a flow within N8N. Only reason I bring this up is because I know you can attach knowledge from vector databases like Pinecone to your "agent" on their end. You could have an HTTP API column trigger the workflow and another source write it back to a webhook in Clay. May be worth checking out. On a completely different thread. Did you see OpenAI released Deep Research today? It looks pretty wild, curious if/when they'll release an API for that as well.

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Interesting. I'll check it out. Thanks!

  • Avatar of Owen C.
    Owen C.
    ·
    ·

    Of course, let me know how else we can help here. :)

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    What about Claude Projects in Clay? Can I access those?

  • Avatar of Owen C.
    Owen C.
    ·
    ·

    Pretty sure Claude Projects are in the same boat as custom GPT's. Haven't tried this personally but checking out this Reddit post it seems as though Claude Projects are not accessible via API's. Reddit

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Thanks!

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Another follow up here... With assistants, it doesn't look like they have access to browse the internet. Do you know any workarounds for this?

  • Avatar of LuisArturo
    LuisArturo
    ·
    ·

    Hey there Andrew, jumping in for Owen here, if you find that you need to access the web with then you can use our Claygent AI option as this has access to scrape the web and then feed the results from this scrape to the assistant to review.

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Thanks!

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·

    Hi Andrew T.! This thread was recently closed by our Support team. If you have a moment, please share your feedback:

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Hey team -- Circling back on this... I've created an assistant and followed the multi-step process above to post a message to my assistant and then run the thread and get the response. One trick is that I can't get the response message until the run is completed. Is there a way in clay to retry an HTTP API column until a status of "Completed" is returned?

  • Avatar of George D.
    George D.
    ·
    ·

    Hey Andrew - we can’t unfortunately. You may be able to use schedules but you’d have to run the column once a day which probably isn’t ideal. Can you have your assistant send a webhook back to a Clay table when the response comes through? That may be your best bet.

  • Avatar of Andrew T.
    Andrew T.
    ·
    ·

    Good idea. Thanks, George!

How to Access Your Private Custom GPT in Clay | Clay