<commit_before>---
title: Managing Service Keys
owner: Core Services
---

<strong><%= modified_date %></strong>

This topic describes managing service instance credentials with service keys.

Service keys provide credentials for manually configuring consumers of marketplace services. Local client, apps in other spaces, or entities outside your deployment can access your service with these keys.

<p class='note'><strong>Note</strong>: Some service brokers do not support service keys. If you want to build a service broker that supports service keys, see <a href="./services/index.html">Services</a>. If you want to use a service broker that does not support service keys, see <a href="./application-binding.html">Delivering Service Credentials to an Application</a>.</p>

## <a id='create'></a> Create a Service Key ##

To generate credentials for a service instance, use the `cf create-service-key` command:

<pre class="terminal">
$ cf create-service-key MY-SERVICE MY-KEY
Creating service key MY-KEY for service instance MY-SERVICE as <EMAIL>...
OK
</pre>

Use the `-c` flag to provide service-specific configuration parameters in a valid JSON object, either in-line or in a file. 

To provide the JSON object in-line, use the following format:

<pre class="terminal">
$ cf create-service-key MY-SERVICE MY-KEY -c '{"permissions":"read-only"}'<commit_msg>fix broken link<commit_after>---
title: Managing Service Keys
owner: Core Services
---

<strong><%= modified_date %></strong>

This topic describes managing service instance credentials with service keys.

Service keys provide credentials for manually configuring consumers of marketplace services. Local client, apps in other spaces, or entities outside your deployment can access your service with these keys.

<p class='note'><strong>Note</strong>: Some service brokers do not support service keys. If you want to build a service broker that supports service keys, see <a href="../../services/index.html">Services</a>. If you want to use a service broker that does not support service keys, see <a href="./application-binding.html">Delivering Service Credentials to an Application</a>.</p>

## <a id='create'></a> Create a Service Key ##

To generate credentials for a service instance, use the `cf create-service-key` command:

<pre class="terminal">
$ cf create-service-key MY-SERVICE MY-KEY
Creating service key MY-KEY for service instance MY-SERVICE as <EMAIL>...
OK
</pre>

Use the `-c` flag to provide service-specific configuration parameters in a valid JSON object, either in-line or in a file. 

To provide the JSON object in-line, use the following format:

<pre class="terminal">
$ cf create-service-key MY-SERVICE MY-KEY -c '{"permissions":"read-only"}'
{'fraction_non_alphanumeric': 0.10256410256410256, 'fraction_numerical': 0.0, 'mean_word_length': 4.7253668763102725, 'pattern_counts': {'":': 2, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7038183', 'n_tokens_mistral': 714, 'n_tokens_neox': 697, 'n_words': 343}